@@ -16,8 +16,8 @@ |
||
| 16 | 16 | public function __invoke(array $extensionNames) : array |
| 17 | 17 | { |
| 18 | 18 | $definedSymbols = []; |
| 19 | - foreach($extensionNames as $extensionName) { |
|
| 20 | - try{ |
|
| 19 | + foreach ($extensionNames as $extensionName) { |
|
| 20 | + try { |
|
| 21 | 21 | $extensionReflection = new \ReflectionExtension($extensionName); |
| 22 | 22 | $definedSymbols = array_merge( |
| 23 | 23 | $definedSymbols, |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | /* @var $file \SplFileInfo */ |
| 27 | 27 | foreach ($files as $file) { |
| 28 | - if (! preg_match($extensionMatcher, $file->getBasename())) { |
|
| 28 | + if (!preg_match($extensionMatcher, $file->getBasename())) { |
|
| 29 | 29 | continue; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | public function __construct(array $options = []) |
| 19 | 19 | { |
| 20 | 20 | foreach ($options as $key => $option) { |
| 21 | - $methodName = 'set'.$this->getCamelCase($key); |
|
| 22 | - if(!method_exists($this, $methodName)) { |
|
| 21 | + $methodName = 'set' . $this->getCamelCase($key); |
|
| 22 | + if (!method_exists($this, $methodName)) { |
|
| 23 | 23 | throw new \InvalidArgumentException($key . ' is not a known option - there is no method ' . $methodName); |
| 24 | 24 | } |
| 25 | 25 | $this->$methodName($option); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | public function __invoke($symbolName) : \Generator |
| 20 | 20 | { |
| 21 | - foreach($this->guessers as $guesser) { |
|
| 21 | + foreach ($this->guessers as $guesser) { |
|
| 22 | 22 | yield from $guesser($symbolName); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function testGuessExtJson() |
| 22 | 22 | { |
| 23 | - if(!extension_loaded('json')) { |
|
| 23 | + if (!extension_loaded('json')) { |
|
| 24 | 24 | $this->markTestSkipped('extension json is not available'); |
| 25 | 25 | } |
| 26 | 26 | $result = $this->guesser->__invoke('json_decode'); |
@@ -25,17 +25,17 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $version = null; |
| 27 | 27 | $pharFile = \Phar::running(); |
| 28 | - if($pharFile) { |
|
| 28 | + if ($pharFile) { |
|
| 29 | 29 | $metadata = (new \Phar($pharFile))->getMetadata(); |
| 30 | 30 | $version = $metadata['version'] ?? null; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if(!$version) { |
|
| 33 | + if (!$version) { |
|
| 34 | 34 | $pwd = getcwd(); |
| 35 | 35 | chdir(realpath(__DIR__ . '/../../../')); |
| 36 | 36 | $gitVersion = @exec('git describe --tags --dirty=-dev --always 2>&1', $output, $returnValue); |
| 37 | 37 | chdir($pwd); |
| 38 | - if($returnValue === 0) { |
|
| 38 | + if ($returnValue === 0) { |
|
| 39 | 39 | $version = $gitVersion; |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | protected function execute(InputInterface $input, OutputInterface $output) : int |
| 46 | 46 | { |
| 47 | 47 | |
| 48 | - if(!$output->isQuiet()) { |
|
| 48 | + if (!$output->isQuiet()) { |
|
| 49 | 49 | $output->writeln($this->getApplication()->getLongVersion()); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $composerJson = realpath($input->getArgument('composer-json')); |
| 53 | - if(false === $composerJson) { |
|
| 53 | + if (false === $composerJson) { |
|
| 54 | 54 | throw new \InvalidArgumentException('file not found: [' . $input->getArgument('composer-json') . ']'); |
| 55 | 55 | } |
| 56 | 56 | $this->checkJsonFile($composerJson); |
@@ -96,20 +96,20 @@ discard block |
||
| 96 | 96 | $guesser = new DependencyGuesser(); |
| 97 | 97 | foreach ($unknownSymbols as $unknownSymbol) { |
| 98 | 98 | $guessedDependencies = []; |
| 99 | - foreach($guesser($unknownSymbol) as $guessedDependency) { |
|
| 99 | + foreach ($guesser($unknownSymbol) as $guessedDependency) { |
|
| 100 | 100 | $guessedDependencies[] = $guessedDependency; |
| 101 | 101 | } |
| 102 | 102 | $table->addRow([$unknownSymbol, implode("\n", $guessedDependencies)]); |
| 103 | 103 | } |
| 104 | 104 | $table->render(); |
| 105 | 105 | |
| 106 | - return ((int) (bool) $unknownSymbols); |
|
| 106 | + return ((int)(bool)$unknownSymbols); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | private function getCheckOptions(InputInterface $input) : Options |
| 110 | 110 | { |
| 111 | 111 | $fileName = $input->getOption('config-file'); |
| 112 | - if(!$fileName) { |
|
| 112 | + if (!$fileName) { |
|
| 113 | 113 | return new Options(); |
| 114 | 114 | } |
| 115 | 115 | return new Options((new JsonLoader($fileName))->getData()); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | private function recordCatchUsage(Node $node) |
| 91 | 91 | { |
| 92 | 92 | if ($node instanceof Node\Stmt\Catch_) { |
| 93 | - foreach($node->types as $type) { |
|
| 93 | + foreach ($node->types as $type) { |
|
| 94 | 94 | $this->recordUsageOf($type); |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | private function recordTraitUsage(Node $node) |
| 148 | 148 | { |
| 149 | - if (! $node instanceof Node\Stmt\TraitUse) { |
|
| 149 | + if (!$node instanceof Node\Stmt\TraitUse) { |
|
| 150 | 150 | return; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | private function recordUsageOf(Node\Name $symbol) |
| 170 | 170 | { |
| 171 | - $this->collectedSymbols[(string) $symbol] = $symbol; |
|
| 171 | + $this->collectedSymbols[(string)$symbol] = $symbol; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | private function recordDefinitionOf(Node $node) |
| 92 | 92 | { |
| 93 | - if (! isset($node->namespacedName)) { |
|
| 93 | + if (!isset($node->namespacedName)) { |
|
| 94 | 94 | throw new \UnexpectedValueException(sprintf( |
| 95 | 95 | 'Given node of type "%s" (defined at line %s)does not have an assigned "namespacedName" property: ' |
| 96 | 96 | . 'did you pass it through a name resolver visitor?', |
@@ -99,6 +99,6 @@ discard block |
||
| 99 | 99 | )); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - $this->definedSymbols[(string) $node->namespacedName] = $node->namespacedName; |
|
| 102 | + $this->definedSymbols[(string)$node->namespacedName] = $node->namespacedName; |
|
| 103 | 103 | } |
| 104 | 104 | } |