@@ -29,14 +29,14 @@ |
||
29 | 29 | { |
30 | 30 | $flattened = array_reduce( |
31 | 31 | $sourceDirs, |
32 | - function (array $sourceDirs, $sourceDir) { |
|
33 | - return array_merge($sourceDirs, (array)$sourceDir); |
|
32 | + function(array $sourceDirs, $sourceDir) { |
|
33 | + return array_merge($sourceDirs, (array) $sourceDir); |
|
34 | 34 | }, |
35 | 35 | [] |
36 | 36 | ); |
37 | 37 | return array_values(array_map( |
38 | - function (string $sourceDir) use ($packageDir) { |
|
39 | - return $packageDir . '/' . ltrim($sourceDir, '/'); |
|
38 | + function(string $sourceDir) use ($packageDir) { |
|
39 | + return $packageDir.'/'.ltrim($sourceDir, '/'); |
|
40 | 40 | }, |
41 | 41 | $flattened |
42 | 42 | )); |
@@ -97,7 +97,7 @@ |
||
97 | 97 | |
98 | 98 | private function traverseStringAST(string $phpSource) : array |
99 | 99 | { |
100 | - return $this->traverser->traverse($this->parser->parse('<?php ' . $phpSource)); |
|
100 | + return $this->traverser->traverse($this->parser->parse('<?php '.$phpSource)); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | private function traverseClassAST(string $className) : array |
@@ -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'); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | $optionsFromFile = new Options( |
41 | 41 | json_decode(file_get_contents( |
42 | - __DIR__ . '/../../../data/config.dist.json' |
|
42 | + __DIR__.'/../../../data/config.dist.json' |
|
43 | 43 | ), true) |
44 | 44 | ); |
45 | 45 |
@@ -52,19 +52,19 @@ discard block |
||
52 | 52 | protected function execute(InputInterface $input, OutputInterface $output) : int |
53 | 53 | { |
54 | 54 | |
55 | - if(!$output->isQuiet()) { |
|
55 | + if (!$output->isQuiet()) { |
|
56 | 56 | $output->writeln($this->getApplication()->getLongVersion()); |
57 | 57 | } |
58 | 58 | |
59 | 59 | $composerJson = realpath($input->getArgument('composer-json')); |
60 | - if(false === $composerJson) { |
|
61 | - throw new \InvalidArgumentException('file not found: [' . $input->getArgument('composer-json') . ']'); |
|
60 | + if (false === $composerJson) { |
|
61 | + throw new \InvalidArgumentException('file not found: ['.$input->getArgument('composer-json').']'); |
|
62 | 62 | } |
63 | 63 | $this->checkJsonFile($composerJson); |
64 | 64 | |
65 | 65 | $getPackageSourceFiles = new LocateComposerPackageSourceFiles(); |
66 | 66 | |
67 | - $sourcesASTs = new LocateASTFromFiles((new ParserFactory())->create(ParserFactory::PREFER_PHP7)); |
|
67 | + $sourcesASTs = new LocateASTFromFiles((new ParserFactory())->create(ParserFactory::PREFER_PHP7)); |
|
68 | 68 | |
69 | 69 | $definedVendorSymbols = (new LocateDefinedSymbolsFromASTRoots())->__invoke($sourcesASTs( |
70 | 70 | (new ComposeGenerators())->__invoke( |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $guesser = new DependencyGuesser(); |
100 | 100 | foreach ($unknownSymbols as $unknownSymbol) { |
101 | 101 | $guessedDependencies = []; |
102 | - foreach($guesser($unknownSymbol) as $guessedDependency) { |
|
102 | + foreach ($guesser($unknownSymbol) as $guessedDependency) { |
|
103 | 103 | $guessedDependencies[] = $guessedDependency; |
104 | 104 | } |
105 | 105 | $table->addRow([$unknownSymbol, implode("\n", $guessedDependencies)]); |
@@ -112,17 +112,17 @@ discard block |
||
112 | 112 | private function getCheckOptions(InputInterface $input) : Options |
113 | 113 | { |
114 | 114 | $fileName = $input->getOption('config-file'); |
115 | - if(!$fileName) { |
|
115 | + if (!$fileName) { |
|
116 | 116 | return new Options(); |
117 | 117 | } |
118 | 118 | |
119 | - if(!is_readable($fileName)) { |
|
120 | - throw new \InvalidArgumentException('unable to read ' . $fileName); |
|
119 | + if (!is_readable($fileName)) { |
|
120 | + throw new \InvalidArgumentException('unable to read '.$fileName); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | $jsonData = json_decode(file_get_contents($fileName), true); |
124 | - if(false === $jsonData) { |
|
125 | - throw new \Exception('error parsing the config file: ' . json_last_error_msg()); |
|
124 | + if (false === $jsonData) { |
|
125 | + throw new \Exception('error parsing the config file: '.json_last_error_msg()); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return new Options($jsonData); |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | */ |
137 | 137 | private function checkJsonFile(string $jsonFile) |
138 | 138 | { |
139 | - if(!is_readable($jsonFile)) { |
|
140 | - throw new InvalidInputFileException('cannot read ' . $jsonFile); |
|
139 | + if (!is_readable($jsonFile)) { |
|
140 | + throw new InvalidInputFileException('cannot read '.$jsonFile); |
|
141 | 141 | } |
142 | 142 | |
143 | - if(false == json_decode(file_get_contents($jsonFile))) { |
|
144 | - throw new InvalidInputFileException('error parsing ' . $jsonFile . ': ' . json_last_error_msg()); |
|
143 | + if (false == json_decode(file_get_contents($jsonFile))) { |
|
144 | + throw new InvalidInputFileException('error parsing '.$jsonFile.': '.json_last_error_msg()); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | } |