Skip to content

Commit 8a18b56

Browse files
committed
minor #13908 [2.3] Static Code Analysis for Components (kalessil)
This PR was squashed before being merged into the 2.3 branch (closes #13908). Discussion ---------- [2.3] Static Code Analysis for Components | Q | A | ------------- | --- | 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), no functional changes: - unused array fill-in removed (dead code) - reduced str_replace calls \Symfony\Component\BrowserKit\Response::getHeader Commits ------- d05cffb [2.3] Static Code Analysis for Components
2 parents 374b718 + d05cffb commit 8a18b56

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Symfony/Component/BrowserKit/Response.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ public function getHeaders()
123123
*/
124124
public function getHeader($header, $first = true)
125125
{
126+
$normalizedHeader = str_replace('-', '_', strtolower($header));
126127
foreach ($this->headers as $key => $value) {
127-
if (str_replace('-', '_', strtolower($key)) == str_replace('-', '_', strtolower($header))) {
128+
if (str_replace('-', '_', strtolower($key)) === $normalizedHeader) {
128129
if ($first) {
129130
return is_array($value) ? (count($value) ? $value[0] : '') : $value;
130131
}

src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,6 @@ private function updateNewFieldAceProperty($name, array $changes)
785785
{
786786
$sids = new \SplObjectStorage();
787787
$classIds = new \SplObjectStorage();
788-
$currentIds = array();
789788
foreach ($changes[1] as $field => $new) {
790789
for ($i = 0, $c = count($new); $i<$c; $i++) {
791790
$ace = $new[$i];
@@ -813,8 +812,6 @@ private function updateNewFieldAceProperty($name, array $changes)
813812
$aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id');
814813
$aceIdProperty->setAccessible(true);
815814
$aceIdProperty->setValue($ace, (int) $aceId);
816-
} else {
817-
$currentIds[$ace->getId()] = true;
818815
}
819816
}
820817
}

0 commit comments

Comments
 (0)