Completed
Pull Request — master (#31)
by
unknown
01:44
created
src/ComposerRequireChecker/NodeVisitor/UsedSymbolCollector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
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 $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 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.
test/ComposerRequireCheckerTest/JsonLoaderTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function testHasErrorWithWrongPath()
15 15
     {
16
-        $path = __DIR__ . '/wrong/path/non-existing-file.json';
16
+        $path = __DIR__.'/wrong/path/non-existing-file.json';
17 17
         $loader = new JsonLoader($path);
18 18
     }
19 19
 
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function testHasErrorWithInvalidFile()
24 24
     {
25
-        $path = __DIR__ . '/../fixtures/invalidJson';
25
+        $path = __DIR__.'/../fixtures/invalidJson';
26 26
         $loader = new JsonLoader($path);
27 27
     }
28 28
 
29 29
     public function testHasDataWithValidFile()
30 30
     {
31
-        $path = __DIR__ . '/../fixtures/validJson.json';
31
+        $path = __DIR__.'/../fixtures/validJson.json';
32 32
         $loader = new JsonLoader($path);
33 33
         $this->assertEquals($loader->getData(), ['foo' => 'bar']);
34 34
     }
Please login to merge, or discard this patch.
src/ComposerRequireChecker/JsonLoader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@
 block discarded – undo
20 20
     public function __construct($path)
21 21
     {
22 22
         if (!is_readable($path) || ($content = file_get_contents($path)) === false) {
23
-            throw new NotReadableException('unable to read ' . $path);
23
+            throw new NotReadableException('unable to read '.$path);
24 24
         }
25 25
         $this->data = json_decode($content, true);
26 26
         if ($this->data === null && JSON_ERROR_NONE !== json_last_error()) {
27
-            throw new InvalidJsonException('error parsing ' . $path . ': ' . json_last_error_msg());
27
+            throw new InvalidJsonException('error parsing '.$path.': '.json_last_error_msg());
28 28
         }
29 29
     }
30 30
 
Please login to merge, or discard this patch.