Completed
Pull Request — master (#31)
by
unknown
01:47
created
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.
src/ComposerRequireChecker/Cli/CheckCommand.php 1 patch
Spacing   +6 added lines, -6 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(
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
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,7 +112,7 @@  discard block
 block discarded – undo
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
         return new Options((new JsonLoader($fileName))->getData());
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
@@ -15,21 +15,21 @@
 block discarded – undo
15 15
 
16 16
     public function testHasErrorWithWrongPath()
17 17
     {
18
-        $path = __DIR__ . '/wrong/path/non-existing-file.json';
18
+        $path = __DIR__.'/wrong/path/non-existing-file.json';
19 19
         $this->expectException(NotReadableException::class);
20 20
         new JsonLoader($path);
21 21
     }
22 22
 
23 23
     public function testHasErrorWithInvalidFile()
24 24
     {
25
-        $path = __DIR__ . '/../fixtures/invalidJson';
25
+        $path = __DIR__.'/../fixtures/invalidJson';
26 26
         $this->expectException(InvalidJsonException::class);
27 27
         new JsonLoader($path);
28 28
     }
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->getData(), ['foo' => 'bar']);
35 35
     }
Please login to merge, or discard this patch.