Passed
Push — master ( 37b180...6b56cf )
by Matthias
06:39
created
NodeVisitor/DefinedSymbolCollectorFunctionalTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace ComposerRequireCheckerTest\NodeVisitor;
4 4
 
5 5
 use ComposerRequireChecker\NodeVisitor\DefinedSymbolCollector;
6
-use PhpParser\Node;
7 6
 use PhpParser\NodeTraverser;
8 7
 use PhpParser\NodeTraverserInterface;
9 8
 use PhpParser\NodeVisitor\NameResolver;
Please login to merge, or discard this 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.
NodeVisitor/UsedSymbolCollectorFunctionalTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace ComposerRequireCheckerTest\NodeVisitor;
4 4
 
5 5
 use ComposerRequireChecker\NodeVisitor\UsedSymbolCollector;
6
-use PhpParser\Node;
7 6
 use PhpParser\NodeTraverser;
8 7
 use PhpParser\NodeTraverserInterface;
9 8
 use PhpParser\NodeVisitor\NameResolver;
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   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
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) {
54
-            throw new \InvalidArgumentException('file not found: [' . $input->getArgument('composer-json') . ']');
53
+        if (false === $composerJson) {
54
+            throw new \InvalidArgumentException('file not found: ['.$input->getArgument('composer-json').']');
55 55
         }
56 56
         $this->checkJsonFile($composerJson);
57 57
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $guesser = new DependencyGuesser();
98 98
         foreach ($unknownSymbols as $unknownSymbol) {
99 99
             $guessedDependencies = [];
100
-            foreach($guesser($unknownSymbol) as $guessedDependency) {
100
+            foreach ($guesser($unknownSymbol) as $guessedDependency) {
101 101
                 $guessedDependencies[] = $guessedDependency;
102 102
             }
103 103
             $table->addRow([$unknownSymbol, implode("\n", $guessedDependencies)]);
@@ -110,17 +110,17 @@  discard block
 block discarded – undo
110 110
     private function getCheckOptions(InputInterface $input) : Options
111 111
     {
112 112
         $fileName = $input->getOption('config-file');
113
-        if(!$fileName) {
113
+        if (!$fileName) {
114 114
             return new Options();
115 115
         }
116 116
 
117
-        if(!is_readable($fileName)) {
118
-            throw new \InvalidArgumentException('unable to read ' . $fileName);
117
+        if (!is_readable($fileName)) {
118
+            throw new \InvalidArgumentException('unable to read '.$fileName);
119 119
         }
120 120
 
121 121
         $jsonData = json_decode(file_get_contents($fileName), true);
122
-        if(false === $jsonData) {
123
-            throw new \Exception('error parsing the config file: ' . json_last_error_msg());
122
+        if (false === $jsonData) {
123
+            throw new \Exception('error parsing the config file: '.json_last_error_msg());
124 124
         }
125 125
 
126 126
         return new Options($jsonData);
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
      */
135 135
     private function checkJsonFile(string $jsonFile)
136 136
     {
137
-        if(!is_readable($jsonFile)) {
138
-            throw new InvalidInputFileException('cannot read ' . $jsonFile);
137
+        if (!is_readable($jsonFile)) {
138
+            throw new InvalidInputFileException('cannot read '.$jsonFile);
139 139
         }
140 140
 
141
-        if(false == json_decode(file_get_contents($jsonFile))) {
142
-            throw new InvalidInputFileException('error parsing ' . $jsonFile . ': ' . json_last_error_msg());
141
+        if (false == json_decode(file_get_contents($jsonFile))) {
142
+            throw new InvalidInputFileException('error parsing '.$jsonFile.': '.json_last_error_msg());
143 143
         }
144 144
 
145 145
     }
Please login to merge, or discard this patch.
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 $this->normalizePath($packageDir . '/' . ltrim($sourceDir, '/'));
38
+            function(string $sourceDir) use ($packageDir) {
39
+                return $this->normalizePath($packageDir.'/'.ltrim($sourceDir, '/'));
40 40
             },
41 41
             $flattened
42 42
         ));
Please login to merge, or discard this patch.