Skip to content

Commit 6ffa4f0

Browse files
committed
minor #22931 SCA with Php Inspections (EA Extended): 2.7 (kalessil)
This PR was squashed before being merged into the 2.7 branch (closes #22931). Discussion ---------- SCA with Php Inspections (EA Extended): 2.7 | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Static Code Analysis with Php Inspections (EA Extended): dead code and control flow tweaks. Commits ------- 598ae56cc9 SCA with Php Inspections (EA Extended): 2.7
2 parents 66dbfdc + 23e8807 commit 6ffa4f0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
8989

9090
if (!is_callable($preferredChoices) && !empty($preferredChoices)) {
9191
$preferredChoices = function ($choice) use ($preferredChoices) {
92-
return false !== array_search($choice, $preferredChoices, true);
92+
return in_array($choice, $preferredChoices, true);
9393
};
9494
}
9595

FormRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,6 @@ public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $va
316316
*/
317317
public function humanize($text)
318318
{
319-
return ucfirst(trim(strtolower(preg_replace(array('/([A-Z])/', '/[_\s]+/'), array('_$1', ' '), $text))));
319+
return ucfirst(strtolower(trim(preg_replace(array('/([A-Z])/', '/[_\s]+/'), array('_$1', ' '), $text))));
320320
}
321321
}

0 commit comments

Comments
 (0)