Skip to content

Commit 637a957

Browse files
committed
minor #13862 [2.3] [Config] [Console] [DependencyInjection] [DomCrawler] [Form] [HttpKernel] [PropertyAccess] [Security] [Translation] [Yaml] static code analysis, code cleanup (kalessil)
This PR was squashed before being merged into the 2.3 branch (closes #13862). Discussion ---------- [2.3] [Config] [Console] [DependencyInjection] [DomCrawler] [Form] [HttpKernel] [PropertyAccess] [Security] [Translation] [Yaml] static code analysis, code cleanup | 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 Split <a href="https://github.com/symfony/symfony/pull/13813">PR 13813</a>: part 1 - targeting v2.3 Following is included (no functional changes, found with <a href="https://plugins.jetbrains.com/plugin/7622?pr=phpStorm">Php Inspections (EA Extended)</a>): - Fixed couple of concatenation as array index warnings - Unset calls can be merged inspection fixes - array_search in in_array context inspection fixes - Is null usage inspection fixes - Prefixed increment/decrement inspection fixes - Elvis operator can be used inspection fixes - Alias functions usage inspection fixes - Ternary operator simplification inspection fixes - _ _ DIR _ _ equivalent inspection fixes Commits ------- f13b5f7 [2.3] [Config] [Console] [DependencyInjection] [DomCrawler] [Form] [HttpKernel] [PropertyAccess] [Security] [Translation] [Yaml] static code analysis, code cleanup
2 parents ad14964 + 4c01bf3 commit 637a957

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

AbstractRendererEngine.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public function setTheme(FormView $view, $themes)
6767
// Unset instead of resetting to an empty array, in order to allow
6868
// implementations (like TwigRendererEngine) to check whether $cacheKey
6969
// is set at all.
70-
unset($this->resources[$cacheKey]);
71-
unset($this->resourceHierarchyLevels[$cacheKey]);
70+
unset($this->resources[$cacheKey], $this->resourceHierarchyLevels[$cacheKey]);
7271
}
7372

7473
/**

FormBuilder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ public function remove($name)
138138
throw new BadMethodCallException('FormBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
139139
}
140140

141-
unset($this->unresolvedChildren[$name]);
142-
unset($this->children[$name]);
141+
unset($this->unresolvedChildren[$name], $this->children[$name]);
143142

144143
return $this;
145144
}

FormRenderer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $va
279279
// Clear the caches if they were filled for the first time within
280280
// this function call
281281
if ($hierarchyInit) {
282-
unset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey]);
283-
unset($this->hierarchyLevelMap[$viewAndSuffixCacheKey]);
282+
unset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey], $this->hierarchyLevelMap[$viewAndSuffixCacheKey]);
284283
}
285284

286285
if ($varInit) {

Test/FormPerformanceTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function runTest()
5454
*/
5555
public function setMaxRunningTime($maxRunningTime)
5656
{
57-
if (is_integer($maxRunningTime) && $maxRunningTime >= 0) {
57+
if (is_int($maxRunningTime) && $maxRunningTime >= 0) {
5858
$this->maxRunningTime = $maxRunningTime;
5959
} else {
6060
throw new \InvalidArgumentException();

0 commit comments

Comments
 (0)