Completed
Push — master ( c4dd08...7768b0 )
by Matthias
02:25
created
src/ComposerRequireChecker/Cli/CheckCommand.php 1 patch
Spacing   +14 added lines, -14 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,17 +112,17 @@  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
 
119
-        if(!is_readable($fileName)) {
120
-            throw new \InvalidArgumentException('unable to read ' . $fileName);
119
+        if (!is_readable($fileName)) {
120
+            throw new \InvalidArgumentException('unable to read '.$fileName);
121 121
         }
122 122
 
123 123
         $jsonData = json_decode(file_get_contents($fileName), true);
124
-        if(false === $jsonData) {
125
-            throw new \Exception('error parsing the config file: ' . json_last_error_msg());
124
+        if (false === $jsonData) {
125
+            throw new \Exception('error parsing the config file: '.json_last_error_msg());
126 126
         }
127 127
 
128 128
         return new Options($jsonData);
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function checkJsonFile(string $jsonFile)
138 138
     {
139
-        if(!is_readable($jsonFile)) {
140
-            throw new InvalidInputFileException('cannot read ' . $jsonFile);
139
+        if (!is_readable($jsonFile)) {
140
+            throw new InvalidInputFileException('cannot read '.$jsonFile);
141 141
         }
142 142
 
143
-        if(false == json_decode(file_get_contents($jsonFile))) {
144
-            throw new InvalidInputFileException('error parsing ' . $jsonFile . ': ' . json_last_error_msg());
143
+        if (false == json_decode(file_get_contents($jsonFile))) {
144
+            throw new InvalidInputFileException('error parsing '.$jsonFile.': '.json_last_error_msg());
145 145
         }
146 146
 
147 147
     }
Please login to merge, or discard this patch.