@@ -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 |
@@ -53,19 +53,19 @@ discard block |
||
53 | 53 | protected function execute(InputInterface $input, OutputInterface $output) : int |
54 | 54 | { |
55 | 55 | |
56 | - if(!$output->isQuiet()) { |
|
56 | + if (!$output->isQuiet()) { |
|
57 | 57 | $output->writeln($this->getApplication()->getLongVersion()); |
58 | 58 | } |
59 | 59 | |
60 | 60 | $composerJson = realpath($input->getArgument('composer-json')); |
61 | - if(false === $composerJson) { |
|
62 | - throw new \InvalidArgumentException('file not found: [' . $input->getArgument('composer-json') . ']'); |
|
61 | + if (false === $composerJson) { |
|
62 | + throw new \InvalidArgumentException('file not found: ['.$input->getArgument('composer-json').']'); |
|
63 | 63 | } |
64 | 64 | $this->checkJsonFile($composerJson); |
65 | 65 | |
66 | 66 | $getPackageSourceFiles = new LocateComposerPackageSourceFiles(); |
67 | 67 | |
68 | - $sourcesASTs = new LocateASTFromFiles((new ParserFactory())->create(ParserFactory::PREFER_PHP7)); |
|
68 | + $sourcesASTs = new LocateASTFromFiles((new ParserFactory())->create(ParserFactory::PREFER_PHP7)); |
|
69 | 69 | |
70 | 70 | $definedVendorSymbols = (new LocateDefinedSymbolsFromASTRoots())->__invoke($sourcesASTs( |
71 | 71 | (new ComposeGenerators())->__invoke( |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $guesser = new DependencyGuesser(); |
101 | 101 | foreach ($unknownSymbols as $unknownSymbol) { |
102 | 102 | $guessedDependencies = []; |
103 | - foreach($guesser($unknownSymbol) as $guessedDependency) { |
|
103 | + foreach ($guesser($unknownSymbol) as $guessedDependency) { |
|
104 | 104 | $guessedDependencies[] = $guessedDependency; |
105 | 105 | } |
106 | 106 | $table->addRow([$unknownSymbol, implode("\n", $guessedDependencies)]); |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | private function getCheckOptions(InputInterface $input) : Options |
114 | 114 | { |
115 | 115 | $fileName = $input->getOption('config-file'); |
116 | - if(!$fileName) { |
|
116 | + if (!$fileName) { |
|
117 | 117 | return new Options(); |
118 | 118 | } |
119 | 119 | |
120 | 120 | $loader = new JsonLoader($fileName); |
121 | 121 | switch ($loader->getErrorCode()) { |
122 | 122 | case JsonLoader::ERROR_NO_READABLE: |
123 | - throw new \InvalidArgumentException('unable to read ' . $fileName); |
|
123 | + throw new \InvalidArgumentException('unable to read '.$fileName); |
|
124 | 124 | case JsonLoader::ERROR_INVALID_JSON: |
125 | - throw new \Exception('error parsing the config file: ' . $loader->getErrorMessage()); |
|
125 | + throw new \Exception('error parsing the config file: '.$loader->getErrorMessage()); |
|
126 | 126 | default: |
127 | 127 | return new Options($loader->getData()); |
128 | 128 | } |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | $loader = new JsonLoader($jsonFile); |
139 | 139 | switch ($loader->getErrorCode()) { |
140 | 140 | case JsonLoader::ERROR_NO_READABLE: |
141 | - throw new InvalidInputFileException('cannot read ' . $jsonFile); |
|
141 | + throw new InvalidInputFileException('cannot read '.$jsonFile); |
|
142 | 142 | case JsonLoader::ERROR_INVALID_JSON: |
143 | - throw new InvalidInputFileException('error parsing ' . $jsonFile . ': ' . $loader->getErrorMessage()); |
|
143 | + throw new InvalidInputFileException('error parsing '.$jsonFile.': '.$loader->getErrorMessage()); |
|
144 | 144 | default: |
145 | 145 | break; |
146 | 146 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function testHasErrorWithWrongPath() |
12 | 12 | { |
13 | - $path = __DIR__ . '/wrong/path/non-existing-file.json'; |
|
13 | + $path = __DIR__.'/wrong/path/non-existing-file.json'; |
|
14 | 14 | $loader = new JsonLoader($path); |
15 | 15 | $this->assertEquals($loader->getErrorCode(), JsonLoader::ERROR_NO_READABLE); |
16 | 16 | $this->assertEquals($loader->getPath(), $path); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | public function testHasErrorWithInvalidFile() |
21 | 21 | { |
22 | - $path = __DIR__ . '/../fixtures/invalidJson'; |
|
22 | + $path = __DIR__.'/../fixtures/invalidJson'; |
|
23 | 23 | $loader = new JsonLoader($path); |
24 | 24 | $this->assertEquals($loader->getErrorCode(), JsonLoader::ERROR_INVALID_JSON); |
25 | 25 | $this->assertEquals($loader->getPath(), $path); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function testHasDataWithValidFile() |
31 | 31 | { |
32 | - $path = __DIR__ . '/../fixtures/validJson.json'; |
|
32 | + $path = __DIR__.'/../fixtures/validJson.json'; |
|
33 | 33 | $loader = new JsonLoader($path); |
34 | 34 | $this->assertEquals($loader->getErrorCode(), JsonLoader::NO_ERROR); |
35 | 35 | $this->assertEquals($loader->getPath(), $path); |