Completed
Pull Request — master (#36)
by
unknown
02:53
created
app/Satis/ConfigManager.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -89,19 +89,19 @@  discard block
 block discarded – undo
89 89
         $repository->setUrl($input->get('url'));
90 90
         $repository->setType($input->get('type', config('satis.default_repository_type')));
91 91
 
92
-        if($input->has('async_mode')) {
92
+        if ($input->has('async_mode')) {
93 93
             $this->configBuilder->setAsyncMode(filter_var($input->get('async_mode'), FILTER_VALIDATE_BOOLEAN));
94 94
         }
95 95
 
96
-        if($input->has('disable_build')) {
96
+        if ($input->has('disable_build')) {
97 97
             $this->setDisableBuild(filter_var($input->get('disable_build'), FILTER_VALIDATE_BOOLEAN));
98 98
         }
99 99
 
100
-        if($repositoryId !== null) {
101
-            if($repositoryCollection->has($repositoryId)) {
100
+        if ($repositoryId !== null) {
101
+            if ($repositoryCollection->has($repositoryId)) {
102 102
                 $repositoryCollection->put($repositoryId, $repository);
103 103
             } else {
104
-                throw new RepositoryNotFoundException('Repository with ID "' . $repositoryId . '" does not exist.');
104
+                throw new RepositoryNotFoundException('Repository with ID "'.$repositoryId.'" does not exist.');
105 105
             }
106 106
         } else {
107 107
             $repositoryId = static::nameToId($repository->getUrl());
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
         $package = new Package();
131 131
         $package->setName($input->get('name'));
132 132
 
133
-        if($input->has('async_mode')) {
133
+        if ($input->has('async_mode')) {
134 134
             $this->configBuilder->setAsyncMode(filter_var($input->get('async_mode'), FILTER_VALIDATE_BOOLEAN));
135 135
         }
136 136
 
137
-        if($input->has('disable_build')) {
137
+        if ($input->has('disable_build')) {
138 138
             $this->setDisableBuild(filter_var($input->get('disable_build'), FILTER_VALIDATE_BOOLEAN));
139 139
         }
140 140
 
141
-        if($packageId !== null) {
142
-            if($packageCollection->has($packageId)) {
141
+        if ($packageId !== null) {
142
+            if ($packageCollection->has($packageId)) {
143 143
                 $packageCollection->put($packageId, $package);
144 144
             } else {
145
-                throw new PackageNotFoundException('Package with ID "' . $packageId . '" does not exist.');
145
+                throw new PackageNotFoundException('Package with ID "'.$packageId.'" does not exist.');
146 146
             }
147 147
         } else {
148 148
             $packageId = static::nameToId($package->getName());
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
      * @throws \App\Satis\Exceptions\RepositoryNotFoundException
166 166
      */
167 167
     protected function _deleteRepository(RepositoryCollection $repositoryCollection, $repositoryId) {
168
-        if($repositoryCollection->has($repositoryId)) {
168
+        if ($repositoryCollection->has($repositoryId)) {
169 169
             $repositoryCollection->forget($repositoryId);
170 170
         } else {
171
-            throw new RepositoryNotFoundException('Repository with ID "' . $repositoryId . '" does not exist.');
171
+            throw new RepositoryNotFoundException('Repository with ID "'.$repositoryId.'" does not exist.');
172 172
         }
173 173
 
174 174
         $this->setDisableBuild(true);
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
      * @throws \App\Satis\Exceptions\RepositoryNotFoundException
184 184
      */
185 185
     protected function _deletePackage(PackageCollection $packageCollection, $packageId) {
186
-        if($packageCollection->has($packageId)) {
186
+        if ($packageCollection->has($packageId)) {
187 187
             $packageCollection->forget($packageId);
188 188
         } else {
189
-            throw new RepositoryNotFoundException('Package with ID "' . $packageId . '" does not exist.');
189
+            throw new RepositoryNotFoundException('Package with ID "'.$packageId.'" does not exist.');
190 190
         }
191 191
 
192 192
         $this->setDisableBuild(true);
@@ -224,32 +224,32 @@  discard block
 block discarded – undo
224 224
      * @throws \Exception
225 225
      */
226 226
     public function __call($method, array $arguments) {
227
-        $method = $this->hiddenEntityPrefix . $method;
227
+        $method = $this->hiddenEntityPrefix.$method;
228 228
 
229
-        if(method_exists($this, $method)) {
229
+        if (method_exists($this, $method)) {
230 230
             $logger = $this->getLogger();
231 231
 
232 232
             $logger->info(str_repeat('=', 30));
233
-            $logger->info('Request => ' . \Request::method() . ' (' . $method .') => '. json_encode($arguments));
233
+            $logger->info('Request => '.\Request::method().' ('.$method.') => '.json_encode($arguments));
234 234
 
235 235
             $type = str_plural(last(explode('_', snake_case($method))), 2);
236 236
 
237
-            array_unshift($arguments, $this->satis->{'get' . ucfirst($type)}());
237
+            array_unshift($arguments, $this->satis->{'get'.ucfirst($type)}());
238 238
 
239 239
             try {
240 240
                 $items = call_user_func_array([$this, $method], $arguments);
241
-            } catch(\Exception $e) {
242
-                $logger->info('Response => ' . $e->getMessage());
241
+            } catch (\Exception $e) {
242
+                $logger->info('Response => '.$e->getMessage());
243 243
                 $logger->info(str_repeat('=', 30));
244 244
 
245 245
                 throw $e;
246 246
             }
247 247
 
248
-            $this->satis->{'set' . $type}($items);
248
+            $this->satis->{'set'.$type}($items);
249 249
 
250 250
             return $this->save();
251 251
         } else {
252
-            throw new BadMethodCallException('Called method "' . $method . '" does not exist.');
252
+            throw new BadMethodCallException('Called method "'.$method.'" does not exist.');
253 253
         }
254 254
     }
255 255
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     public function __get($property) {
261 261
         $property = $this->hiddenEntityPrefix.$property;
262 262
 
263
-        if(isset($this->lazyLoadedProperties[$property])) {
263
+        if (isset($this->lazyLoadedProperties[$property])) {
264 264
             $this->{$property} = $this->{$this->lazyLoadedProperties[$property]}();
265 265
             
266 266
             unset($this->lazyLoadedProperties[$property]);
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
     public function getRepositories($repositoryId = null) {
288 288
         $repositoryCollection = $this->satis->getRepositories();
289 289
 
290
-        if($repositoryId !== null) {
291
-            if(!$repositoryCollection->has($repositoryId)) {
292
-                throw new RepositoryNotFoundException('Repository with ID "' . $repositoryId . '" does not exist.');
290
+        if ($repositoryId !== null) {
291
+            if (!$repositoryCollection->has($repositoryId)) {
292
+                throw new RepositoryNotFoundException('Repository with ID "'.$repositoryId.'" does not exist.');
293 293
             }
294 294
 
295 295
             $output = $repositoryCollection->get($repositoryId);
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
     public function getPackages($packageId = null) {
309 309
         $packageCollection = $this->satis->getPackages();
310 310
 
311
-        if($packageId !== null) {
312
-            if(!$packageCollection->has($packageId)) {
313
-                throw new PackageNotFoundException('Package with ID "' . $packageId . '" does not exist.');
311
+        if ($packageId !== null) {
312
+            if (!$packageCollection->has($packageId)) {
313
+                throw new PackageNotFoundException('Package with ID "'.$packageId.'" does not exist.');
314 314
             }
315 315
 
316 316
             $output = $packageCollection->get($packageId);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
      * @param \App\Satis\BuildContext $buildContext
326 326
      */
327 327
     public function forceBuild(BuildContext $buildContext) {
328
-        if($buildContext->getItemName() !== null) {
328
+        if ($buildContext->getItemName() !== null) {
329 329
             $buildContext->setItemId(self::nameToId($buildContext->getItemName()));
330 330
         }
331 331
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
         $this->configPersister->updateWith($satisConfig);
358 358
 
359
-        if($this->disableBuild === false) {
359
+        if ($this->disableBuild === false) {
360 360
             return $this->configBuilder->build();
361 361
         }
362 362
 
Please login to merge, or discard this patch.
app/Satis/Context/AsyncCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      * @return string
17 17
      */
18 18
     public function getOutputRedirection($logFile) {
19
-        return '&> ' . escapeshellarg($logFile);
19
+        return '&> '.escapeshellarg($logFile);
20 20
     }
21 21
 
22 22
 	/**
Please login to merge, or discard this patch.
app/Satis/ConfigBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         $command = new BuildCommand(
59 59
             $this->buildContext->getConfigFile(),
60
-            config('satis.build_directory') . DIRECTORY_SEPARATOR . $this->buildContext->getBuildDirectory(),
60
+            config('satis.build_directory').DIRECTORY_SEPARATOR.$this->buildContext->getBuildDirectory(),
61 61
             config('satis.proxy')
62 62
         );
63 63
 
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
         $output = null;
67 67
         try {
68 68
             $output = $command->withCd(base_path())->run($this->asyncMode);
69
-        } catch(PackageBuildFailedException $e) {
69
+        } catch (PackageBuildFailedException $e) {
70 70
             $output = $e->getMessage();
71 71
         } finally {
72
-            if($this->asyncMode === false) {
72
+            if ($this->asyncMode === false) {
73 73
                 $this->configPersister->unlock($this->buildContext->getItemId());
74 74
             }
75 75
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Controller.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      * @param \Illuminate\Http\Request $request
25 25
      */
26 26
     protected function build(ConfigManager $configManager, BuildContext $buildContext, Request $request) {
27
-        if($request->ajax()) {
27
+        if ($request->ajax()) {
28 28
             $buildContext->setItemName($request->get('what'));
29 29
 
30 30
             $configManager->setDisableBuild(true)
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
                 ->setConfig($configManager->getDefinition())
58 58
                 ->setRepositoryTypes(config('satis.repository_types'))
59 59
                 ->isLoaded(true);
60
-        } catch(Exception $e) {
60
+        } catch (Exception $e) {
61 61
             $message = $e->getMessage();
62
-            if($e instanceof FileNotFoundException) {
62
+            if ($e instanceof FileNotFoundException) {
63 63
                 $message = trans('satis.not_found');
64 64
             }
65 65
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         return view('index', [
75 75
             'satis' => $serializer->serialize($controlPanelConfig, 'json'),
76 76
             'webpackDevServer' => config('satis.webpack_dev_server'),
77
-            'nodeServer' => config('satis.node.host') . ':' . config('satis.node.port')
77
+            'nodeServer' => config('satis.node.host').':'.config('satis.node.port')
78 78
         ]);
79 79
     }
80 80
 
Please login to merge, or discard this patch.
app/Satis/ConfigMirror.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         $homepage = $publicConfig->getHomepage();
42 42
 
43
-        $publicConfig->setHomepage(rtrim($homepage, '/') . '/' . config('satis.public_repository'))
43
+        $publicConfig->setHomepage(rtrim($homepage, '/').'/'.config('satis.public_repository'))
44 44
             ->setRequireAll(false)
45 45
             ->setRepositories(new RepositoryCollection([$repository]));
46 46
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         $homepage = $privateConfig->getHomepage();
63 63
 
64
-        $privateConfig->setHomepage(rtrim($homepage, '/') . '/' . config('satis.private_repository'))
64
+        $privateConfig->setHomepage(rtrim($homepage, '/').'/'.config('satis.private_repository'))
65 65
             ->setRequireAll(true)
66 66
             ->setProviders(true)
67 67
             ->setPackages(new PackageCollection());
Please login to merge, or discard this patch.
app/Satis/BuildCommand.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -54,21 +54,21 @@  discard block
 block discarded – undo
54 54
      * @return Collection
55 55
      */
56 56
     protected function compile(CommandContextInterface $commandContext) {
57
-        $this->logFile = storage_path('logs/async/' . (string) round(microtime(true) * 1000) .
58
-            mt_rand(1, 10000) . '.log');
57
+        $this->logFile = storage_path('logs/async/'.(string) round(microtime(true) * 1000).
58
+            mt_rand(1, 10000).'.log');
59 59
 
60 60
         $memoryLimit = config('satis.memory_limit');
61 61
         $buildVerbosity = config('satis.build_verbosity');
62 62
 
63 63
         $chunks = new Collection([
64
-            'php' . ($memoryLimit !== null ? ' -dmemory_limit=' . $memoryLimit : ''),
64
+            'php'.($memoryLimit !== null ? ' -dmemory_limit='.$memoryLimit : ''),
65 65
             sprintf($this->executable, DIRECTORY_SEPARATOR),
66
-            $this->command . ($buildVerbosity !== null ? ' -' . $buildVerbosity : ''),
66
+            $this->command.($buildVerbosity !== null ? ' -'.$buildVerbosity : ''),
67 67
             $this->configPath,
68 68
             $this->buildDirectory
69 69
         ]);
70 70
 
71
-        if($this->item !== null) {
71
+        if ($this->item !== null) {
72 72
             $chunks->push($this->item);
73 73
         }
74 74
 
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
             $chunks->push($commandContext->getSendMailOnError($email, $message));
83 83
         }
84 84
 
85
-        foreach(['http', 'https'] as $protocol) {
85
+        foreach (['http', 'https'] as $protocol) {
86 86
             $proxy = $this->proxySettings->get($protocol);
87
-            if($proxy !== null) {
88
-                $chunks->prepend(strtoupper($protocol) . '_PROXY=' . $proxy);
87
+            if ($proxy !== null) {
88
+                $chunks->prepend(strtoupper($protocol).'_PROXY='.$proxy);
89 89
             }
90 90
         }
91 91
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $logger = $commandContext->getLogger();
120 120
 
121 121
         $logger->info(str_repeat('=', 30));
122
-        $logger->info('Running command => ' . PHP_EOL . $commandChunks->implode(' '));
122
+        $logger->info('Running command => '.PHP_EOL.$commandChunks->implode(' '));
123 123
 
124 124
         chdir($this->directory);
125 125
 
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 
128 128
         chdir($this->currentDirectory);
129 129
 
130
-        if($commandContext instanceof SyncCommand) {
131
-            $logger->info('Command output => ' . implode(PHP_EOL, $output));
130
+        if ($commandContext instanceof SyncCommand) {
131
+            $logger->info('Command output => '.implode(PHP_EOL, $output));
132 132
         } else {
133
-            $logger->notice('Command output can be found in "' . $this->logFile . '".');
133
+            $logger->notice('Command output can be found in "'.$this->logFile.'".');
134 134
         }
135 135
 
136 136
         $this->setCommandOutput($output);
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
      * @param string $item
177 177
      */
178 178
     public function setItem($item) {
179
-        if($item === null) {
179
+        if ($item === null) {
180 180
             return;
181 181
         }
182 182
 
183
-        if(preg_match(Repository::REGEX, $item)) {
184
-            $this->item = '--repository-url ' . escapeshellarg($item);
183
+        if (preg_match(Repository::REGEX, $item)) {
184
+            $this->item = '--repository-url '.escapeshellarg($item);
185 185
         } else {
186 186
             $this->item = escapeshellarg($item);
187 187
         }
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
     public function run($asyncMode = true) {
217 217
         # -- force sync
218 218
         #if(true) {
219
-        if($asyncMode === false || $this->isWindows() === true) {
220
-            if($this->isWindows() === true) {
219
+        if ($asyncMode === false || $this->isWindows() === true) {
220
+            if ($this->isWindows() === true) {
221 221
                 $this->getLogger()
222 222
                     ->warn('OS does not support async mode, forcing sync.');
223 223
             }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         $result = $this->exec(new SyncCommand());
241 241
 
242
-        if($result !== 0) {
242
+        if ($result !== 0) {
243 243
             throw new PackageBuildFailedException('Package build failed. Check build log for details.');
244 244
         }
245 245
 
Please login to merge, or discard this patch.