minor #13863 [2.6] [Console] [OptionsResolver] static code analysis, code cleanup (kalessil)
This PR was submitted for the 2.7 branch but it was merged into the 2.6 branch instead (closes #13863).
Discussion
----------
[2.6] [Console] [OptionsResolver] 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 2 - targeting v2.6
Following is included (no functional changes, found with <a href="https://plugins.jetbrains.com/plugin/7622?pr=phpStorm">Php Inspections (EA Extended)</a>):
- Unset calls can be merged inspection fixes
- Alias functions usage inspection fixes
Commits
-------
1530c35
Php Inspections (EA Extended): squash all PR-13813 commits
This commit is contained in:
commit
53570ebd61
@ -208,7 +208,7 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
|
|||||||
protected function getInputStream($input)
|
protected function getInputStream($input)
|
||||||
{
|
{
|
||||||
$stream = fopen('php://memory', 'r+', false);
|
$stream = fopen('php://memory', 'r+', false);
|
||||||
fputs($stream, $input);
|
fwrite($stream, $input);
|
||||||
rewind($stream);
|
rewind($stream);
|
||||||
|
|
||||||
return $stream;
|
return $stream;
|
||||||
|
@ -670,14 +670,8 @@ class OptionsResolver implements Options, OptionsResolverInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ((array) $optionNames as $option) {
|
foreach ((array) $optionNames as $option) {
|
||||||
unset($this->defined[$option]);
|
unset($this->defined[$option], $this->defaults[$option], $this->required[$option], $this->resolved[$option]);
|
||||||
unset($this->defaults[$option]);
|
unset($this->lazy[$option], $this->normalizers[$option], $this->allowedTypes[$option], $this->allowedValues[$option]);
|
||||||
unset($this->required[$option]);
|
|
||||||
unset($this->resolved[$option]);
|
|
||||||
unset($this->lazy[$option]);
|
|
||||||
unset($this->normalizers[$option]);
|
|
||||||
unset($this->allowedTypes[$option]);
|
|
||||||
unset($this->allowedValues[$option]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Reference in New Issue
Block a user