@@ -104,7 +104,7 @@ |
||
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * @param CommandContextInterface $commandContext |
| 107 | - * @return mixed |
|
| 107 | + * @return integer|null |
|
| 108 | 108 | */ |
| 109 | 109 | protected function exec(CommandContextInterface $commandContext) { |
| 110 | 110 | $commandChunks = $this->compile($commandContext); |
@@ -54,31 +54,31 @@ discard block |
||
| 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 | |
| 75 | 75 | $chunks->push($commandContext->getOutputRedirection($this->logFile)); |
| 76 | 76 | $chunks->push($commandContext->getShouldUnlockOnCompletion()); |
| 77 | 77 | |
| 78 | - foreach(['http', 'https'] as $protocol) { |
|
| 78 | + foreach (['http', 'https'] as $protocol) { |
|
| 79 | 79 | $proxy = $this->proxySettings->get($protocol); |
| 80 | - if($proxy !== null) { |
|
| 81 | - $chunks->prepend(strtoupper($protocol) . '_PROXY=' . $proxy); |
|
| 80 | + if ($proxy !== null) { |
|
| 81 | + $chunks->prepend(strtoupper($protocol).'_PROXY='.$proxy); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $logger = $commandContext->getLogger(); |
| 113 | 113 | |
| 114 | 114 | $logger->info(str_repeat('=', 30)); |
| 115 | - $logger->info('Running command => ' . PHP_EOL . $commandChunks->implode(' ')); |
|
| 115 | + $logger->info('Running command => '.PHP_EOL.$commandChunks->implode(' ')); |
|
| 116 | 116 | |
| 117 | 117 | chdir($this->directory); |
| 118 | 118 | |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | chdir($this->currentDirectory); |
| 122 | 122 | |
| 123 | - if($commandContext instanceof SyncCommand) { |
|
| 124 | - $logger->info('Command output => ' . implode(PHP_EOL, $output)); |
|
| 123 | + if ($commandContext instanceof SyncCommand) { |
|
| 124 | + $logger->info('Command output => '.implode(PHP_EOL, $output)); |
|
| 125 | 125 | } else { |
| 126 | - $logger->notice('Command output can be found in "' . $this->logFile . '".'); |
|
| 126 | + $logger->notice('Command output can be found in "'.$this->logFile.'".'); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | $this->setCommandOutput($output); |
@@ -169,12 +169,12 @@ discard block |
||
| 169 | 169 | * @param string $item |
| 170 | 170 | */ |
| 171 | 171 | public function setItem($item) { |
| 172 | - if($item === null) { |
|
| 172 | + if ($item === null) { |
|
| 173 | 173 | return; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - if(preg_match(Repository::REGEX, $item)) { |
|
| 177 | - $this->item = '--repository-url ' . escapeshellarg($item); |
|
| 176 | + if (preg_match(Repository::REGEX, $item)) { |
|
| 177 | + $this->item = '--repository-url '.escapeshellarg($item); |
|
| 178 | 178 | } else { |
| 179 | 179 | $this->item = escapeshellarg($item); |
| 180 | 180 | } |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | public function run($asyncMode = true) { |
| 210 | 210 | # -- force sync |
| 211 | 211 | #if(true) { |
| 212 | - if($asyncMode === false || $this->isWindows() === true) { |
|
| 213 | - if($this->isWindows() === true) { |
|
| 212 | + if ($asyncMode === false || $this->isWindows() === true) { |
|
| 213 | + if ($this->isWindows() === true) { |
|
| 214 | 214 | $this->getLogger() |
| 215 | 215 | ->warn('OS does not support async mode, forcing sync.'); |
| 216 | 216 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $result = $this->exec(new SyncCommand()); |
| 234 | 234 | |
| 235 | - if($result !== 0) { |
|
| 235 | + if ($result !== 0) { |
|
| 236 | 236 | throw new PackageBuildFailedException('Package build failed. Check build log for details.'); |
| 237 | 237 | } |
| 238 | 238 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * @param \App\Satis\Collections\PackageCollection $packageCollection |
| 122 | 122 | * @param string $packageId |
| 123 | 123 | * @param \Illuminate\Support\Collection $input |
| 124 | - * @return \App\Satis\Collections\RepositoryCollection |
|
| 124 | + * @return PackageCollection |
|
| 125 | 125 | * @throws \App\Satis\Exceptions\PackageNotFoundException |
| 126 | 126 | */ |
| 127 | 127 | protected function _addOrUpdatePackage(PackageCollection $packageCollection, $packageId, |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | /** |
| 180 | 180 | * @param \App\Satis\Collections\PackageCollection $packageCollection |
| 181 | 181 | * @param string $packageId |
| 182 | - * @return \App\Satis\Collections\RepositoryCollection |
|
| 182 | + * @return PackageCollection |
|
| 183 | 183 | * @throws \App\Satis\Exceptions\RepositoryNotFoundException |
| 184 | 184 | */ |
| 185 | 185 | protected function _deletePackage(PackageCollection $packageCollection, $packageId) { |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | return $this->serializer->serialize($output, 'json'); |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - /** |
|
| 318 | + /** |
|
| 319 | 319 | * @param string|null $packageId |
| 320 | 320 | * @return string |
| 321 | 321 | * @throws \App\Satis\Exceptions\PackageNotFoundException |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | return $this->serializer->serialize($output, 'json'); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - /** |
|
| 339 | + /** |
|
| 340 | 340 | * @param \App\Satis\BuildContext $buildContext |
| 341 | 341 | */ |
| 342 | 342 | public function forceBuild(BuildContext $buildContext) { |
@@ -89,19 +89,19 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | { |
| 46 | 46 | if ($e instanceof ModelNotFoundException) { |
| 47 | 47 | $e = new NotFoundHttpException($e->getMessage(), $e); |
| 48 | - } elseif($e instanceof HttpException && \App::isLocal() === false) { |
|
| 48 | + } elseif ($e instanceof HttpException && \App::isLocal() === false) { |
|
| 49 | 49 | Response::json(['result' => false, 'message' => $e->getMessage()]) |
| 50 | 50 | ->setStatusCode($e->getStatusCode()) |
| 51 | 51 | ->send(); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $repositories = $configManager->getPackages($packageId); |
| 66 | 66 | |
| 67 | 67 | Response::make($repositories) |
| 68 | - ->send(); |
|
| 68 | + ->send(); |
|
| 69 | 69 | } catch(RepositoryNotFoundException $e) { |
| 70 | 70 | Response::json() |
| 71 | 71 | ->setStatusCode(404) |
@@ -117,5 +117,5 @@ discard block |
||
| 117 | 117 | ->setStatusCode(500) |
| 118 | 118 | ->send(); |
| 119 | 119 | } |
| 120 | - } |
|
| 120 | + } |
|
| 121 | 121 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ] |
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | - if($validator->fails()) { |
|
| 37 | + if ($validator->fails()) { |
|
| 38 | 38 | Response::json($validator->errors()->first('name')) |
| 39 | 39 | ->setStatusCode(400) |
| 40 | 40 | ->send(); |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | Response::json(['command_output' => $output]) |
| 46 | 46 | ->send(); |
| 47 | - } catch(PackageBuildFailedException $e) { |
|
| 47 | + } catch (PackageBuildFailedException $e) { |
|
| 48 | 48 | Response::json() |
| 49 | 49 | ->setStatusCode(500) |
| 50 | 50 | ->send(); |
| 51 | - } catch(RepositoryNotFoundException $e) { |
|
| 51 | + } catch (RepositoryNotFoundException $e) { |
|
| 52 | 52 | Response::json() |
| 53 | 53 | ->setStatusCode(404) |
| 54 | 54 | ->send(); |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | Response::make($repositories) |
| 68 | 68 | ->send(); |
| 69 | - } catch(RepositoryNotFoundException $e) { |
|
| 69 | + } catch (RepositoryNotFoundException $e) { |
|
| 70 | 70 | Response::json() |
| 71 | 71 | ->setStatusCode(404) |
| 72 | 72 | ->send(); |
| 73 | - } catch(PackageBuildFailedException $e) { |
|
| 73 | + } catch (PackageBuildFailedException $e) { |
|
| 74 | 74 | Response::json($e->getMessage()) |
| 75 | 75 | ->setStatusCode(500) |
| 76 | 76 | ->send(); |
@@ -108,11 +108,11 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | Response::json() |
| 110 | 110 | ->send(); |
| 111 | - } catch(RepositoryNotFoundException $e) { |
|
| 111 | + } catch (RepositoryNotFoundException $e) { |
|
| 112 | 112 | Response::json() |
| 113 | 113 | ->setStatusCode(404) |
| 114 | 114 | ->send(); |
| 115 | - } catch(PackageBuildFailedException $e) { |
|
| 115 | + } catch (PackageBuildFailedException $e) { |
|
| 116 | 116 | Response::json($e->getMessage()) |
| 117 | 117 | ->setStatusCode(500) |
| 118 | 118 | ->send(); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $repositories = $configManager->getRepositories($repositoryId); |
| 66 | 66 | |
| 67 | 67 | Response::make($repositories) |
| 68 | - ->send(); |
|
| 68 | + ->send(); |
|
| 69 | 69 | } catch(RepositoryNotFoundException $e) { |
| 70 | 70 | Response::json() |
| 71 | 71 | ->setStatusCode(404) |
@@ -117,5 +117,5 @@ discard block |
||
| 117 | 117 | ->setStatusCode(500) |
| 118 | 118 | ->send(); |
| 119 | 119 | } |
| 120 | - } |
|
| 120 | + } |
|
| 121 | 121 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ] |
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | - if($validator->fails()) { |
|
| 37 | + if ($validator->fails()) { |
|
| 38 | 38 | Response::json($validator->errors()->first('url')) |
| 39 | 39 | ->setStatusCode(400) |
| 40 | 40 | ->send(); |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | Response::json(['command_output' => $output]) |
| 46 | 46 | ->send(); |
| 47 | - } catch(PackageBuildFailedException $e) { |
|
| 47 | + } catch (PackageBuildFailedException $e) { |
|
| 48 | 48 | Response::json() |
| 49 | 49 | ->setStatusCode(500) |
| 50 | 50 | ->send(); |
| 51 | - } catch(RepositoryNotFoundException $e) { |
|
| 51 | + } catch (RepositoryNotFoundException $e) { |
|
| 52 | 52 | Response::json() |
| 53 | 53 | ->setStatusCode(404) |
| 54 | 54 | ->send(); |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | Response::make($repositories) |
| 68 | 68 | ->send(); |
| 69 | - } catch(RepositoryNotFoundException $e) { |
|
| 69 | + } catch (RepositoryNotFoundException $e) { |
|
| 70 | 70 | Response::json() |
| 71 | 71 | ->setStatusCode(404) |
| 72 | 72 | ->send(); |
| 73 | - } catch(PackageBuildFailedException $e) { |
|
| 73 | + } catch (PackageBuildFailedException $e) { |
|
| 74 | 74 | Response::json($e->getMessage()) |
| 75 | 75 | ->setStatusCode(500) |
| 76 | 76 | ->send(); |
@@ -108,11 +108,11 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | Response::json() |
| 110 | 110 | ->send(); |
| 111 | - } catch(RepositoryNotFoundException $e) { |
|
| 111 | + } catch (RepositoryNotFoundException $e) { |
|
| 112 | 112 | Response::json() |
| 113 | 113 | ->setStatusCode(404) |
| 114 | 114 | ->send(); |
| 115 | - } catch(PackageBuildFailedException $e) { |
|
| 115 | + } catch (PackageBuildFailedException $e) { |
|
| 116 | 116 | Response::json($e->getMessage()) |
| 117 | 117 | ->setStatusCode(500) |
| 118 | 118 | ->send(); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @author Lukas Homza <[email protected]> |
| 19 | 19 | */ |
| 20 | 20 | class Controller extends BaseController { |
| 21 | - /** |
|
| 21 | + /** |
|
| 22 | 22 | * @param \App\Satis\ConfigManager $configManager |
| 23 | 23 | * @param \App\Satis\BuildContext $buildContext |
| 24 | 24 | * @param \Illuminate\Http\Request $request |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ]); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - /** |
|
| 76 | + /** |
|
| 77 | 77 | * @param \App\Satis\ConfigManager $configManager |
| 78 | 78 | * @param \Illuminate\Http\Request $request |
| 79 | 79 | */ |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $this->build($configManager, new PrivateRepository(), $request); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - /** |
|
| 84 | + /** |
|
| 85 | 85 | * @param \App\Satis\ConfigManager $configManager |
| 86 | 86 | * @param \Illuminate\Http\Request $request |
| 87 | 87 | */ |
@@ -24,7 +24,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function map(Router $router) |
| 39 | 39 | { |
| 40 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
| 40 | + $router->group(['namespace' => $this->namespace], function($router) { |
|
| 41 | 41 | require app_path('Http/routes.php'); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * @author Lukas Homza <[email protected]> |
| 24 | 24 | */ |
| 25 | 25 | class SatisServiceProvider extends ServiceProvider { |
| 26 | - /** |
|
| 26 | + /** |
|
| 27 | 27 | * @return void |
| 28 | 28 | */ |
| 29 | 29 | public function boot() { |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | 'json', |
| 56 | 56 | function(VisitorInterface $visitor, Collection $collection, array $type, Context $context) { |
| 57 | 57 | $output = []; |
| 58 | - foreach($collection->values() as $package) { |
|
| 58 | + foreach ($collection->values() as $package) { |
|
| 59 | 59 | /** @var Package $package */ |
| 60 | 60 | |
| 61 | 61 | $output[$package->getName()] = $package->getVersion(); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if(!$output) { |
|
| 64 | + if (!$output) { |
|
| 65 | 65 | return null; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $repositories = $visitor->visitArray($data, $type, $context); |
| 82 | 82 | |
| 83 | 83 | $collection = new RepositoryCollection(); |
| 84 | - foreach($repositories as $repository) { |
|
| 84 | + foreach ($repositories as $repository) { |
|
| 85 | 85 | $collection->put($repository->getId(), $repository); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'json', |
| 96 | 96 | function(VisitorInterface $visitor, array $data, array $type, Context $context) { |
| 97 | 97 | $temp = []; |
| 98 | - foreach($data as $name => $version) { |
|
| 98 | + foreach ($data as $name => $version) { |
|
| 99 | 99 | $temp[] = ['name' => $name, 'version' => $version]; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $packages = $visitor->visitArray($temp, $type, $context); |
| 104 | 104 | |
| 105 | 105 | $collection = new PackageCollection(); |
| 106 | - foreach($packages as $package) { |
|
| 106 | + foreach ($packages as $package) { |
|
| 107 | 107 | $collection->put($package->getId(), $package); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | /** @var string $itemName */ |
| 13 | 13 | protected $itemName; |
| 14 | 14 | |
| 15 | - /** |
|
| 15 | + /** |
|
| 16 | 16 | * @return int |
| 17 | 17 | */ |
| 18 | 18 | abstract public function getType(); |