Completed
Pull Request — master (#26)
by Matthias
03:48
created
src/ComposerRequireChecker/FileLocator/LocateComposerPackageSourceFiles.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
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
         ));
Please login to merge, or discard this patch.
NodeVisitor/DefinedSymbolCollectorFunctionalTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
test/ComposerRequireCheckerTest/Cli/OptionsTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/ComposerRequireChecker/Cli/CheckCommand.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
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(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $options->getSymbolWhitelist()
89 89
         );
90 90
 
91
-        $output->writeln("Symbols checked: " . count($usedSymbols));
91
+        $output->writeln("Symbols checked: ".count($usedSymbols));
92 92
 
93 93
         if (!$unknownSymbols) {
94 94
             $output->writeln("There were no unknown symbols found.");
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $guesser = new DependencyGuesser();
102 102
         foreach ($unknownSymbols as $unknownSymbol) {
103 103
             $guessedDependencies = [];
104
-            foreach($guesser($unknownSymbol) as $guessedDependency) {
104
+            foreach ($guesser($unknownSymbol) as $guessedDependency) {
105 105
                 $guessedDependencies[] = $guessedDependency;
106 106
             }
107 107
             $table->addRow([$unknownSymbol, implode("\n", $guessedDependencies)]);
@@ -114,17 +114,17 @@  discard block
 block discarded – undo
114 114
     private function getCheckOptions(InputInterface $input) : Options
115 115
     {
116 116
         $fileName = $input->getOption('config-file');
117
-        if(!$fileName) {
117
+        if (!$fileName) {
118 118
             return new Options();
119 119
         }
120 120
 
121
-        if(!is_readable($fileName)) {
122
-            throw new \InvalidArgumentException('unable to read ' . $fileName);
121
+        if (!is_readable($fileName)) {
122
+            throw new \InvalidArgumentException('unable to read '.$fileName);
123 123
         }
124 124
 
125 125
         $jsonData = json_decode(file_get_contents($fileName), true);
126
-        if(false === $jsonData) {
127
-            throw new \Exception('error parsing the config file: ' . json_last_error_msg());
126
+        if (false === $jsonData) {
127
+            throw new \Exception('error parsing the config file: '.json_last_error_msg());
128 128
         }
129 129
 
130 130
         return new Options($jsonData);
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
      */
139 139
     private function checkJsonFile(string $jsonFile)
140 140
     {
141
-        if(!is_readable($jsonFile)) {
142
-            throw new InvalidInputFileException('cannot read ' . $jsonFile);
141
+        if (!is_readable($jsonFile)) {
142
+            throw new InvalidInputFileException('cannot read '.$jsonFile);
143 143
         }
144 144
 
145
-        if(false == json_decode(file_get_contents($jsonFile))) {
146
-            throw new InvalidInputFileException('error parsing ' . $jsonFile . ': ' . json_last_error_msg());
145
+        if (false == json_decode(file_get_contents($jsonFile))) {
146
+            throw new InvalidInputFileException('error parsing '.$jsonFile.': '.json_last_error_msg());
147 147
         }
148 148
 
149 149
     }
Please login to merge, or discard this patch.