| 1 | <?php |
||
| 16 | final class Php7CodeSnifferExtension extends CompilerExtension |
||
| 17 | { |
||
| 18 | use ExtensionHelperTrait; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | */ |
||
| 23 | public function loadConfiguration() |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function beforeCompile() |
||
| 32 | { |
||
| 33 | $this->loadConsoleCommandsToConsoleApplication(); |
||
| 34 | $this->loadOptionResolversToConfigurationResolver(); |
||
| 35 | } |
||
| 36 | |||
| 37 | private function loadServicesFromConfig() |
||
| 38 | { |
||
| 39 | $config = $this->loadFromFile(__DIR__ . '/../config/services.neon'); |
||
| 40 | $this->compiler->parseServices($this->getContainerBuilder(), $config); |
||
| 41 | } |
||
| 42 | |||
| 43 | private function loadConsoleCommandsToConsoleApplication() |
||
| 47 | |||
| 48 | private function loadOptionResolversToConfigurationResolver() |
||
| 49 | { |
||
| 56 | } |
||
| 57 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.