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:
Fabien Potencier 2015-03-07 08:39:22 +01:00
commit 53570ebd61
2 changed files with 3 additions and 9 deletions

View File

@ -208,7 +208,7 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
protected function getInputStream($input)
{
$stream = fopen('php://memory', 'r+', false);
fputs($stream, $input);
fwrite($stream, $input);
rewind($stream);
return $stream;

View File

@ -670,14 +670,8 @@ class OptionsResolver implements Options, OptionsResolverInterface
}
foreach ((array) $optionNames as $option) {
unset($this->defined[$option]);
unset($this->defaults[$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]);
unset($this->defined[$option], $this->defaults[$option], $this->required[$option], $this->resolved[$option]);
unset($this->lazy[$option], $this->normalizers[$option], $this->allowedTypes[$option], $this->allowedValues[$option]);
}
return $this;