@@ -18,7 +18,7 @@ |
||
18 | 18 | * @return $this |
19 | 19 | */ |
20 | 20 | public function put($key, $value) { |
21 | - if(!$value instanceof Repository) { |
|
21 | + if (!$value instanceof Repository) { |
|
22 | 22 | throw new InvalidArgumentException('RepositoryCollection accepts only elements of "Repository" type.'); |
23 | 23 | } |
24 | 24 |
@@ -66,10 +66,10 @@ |
||
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 | } |
@@ -89,16 +89,16 @@ 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 | 104 | throw new RepositoryNotFoundException('Repository with ID "' . $repositoryId . '" does not exist.'); |
@@ -130,16 +130,16 @@ 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 | 145 | throw new PackageNotFoundException('Package with ID "' . $packageId . '" does not exist.'); |
@@ -165,7 +165,7 @@ 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 | 171 | throw new RepositoryNotFoundException('Repository with ID "' . $repositoryId . '" does not exist.'); |
@@ -183,7 +183,7 @@ 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 | 189 | throw new RepositoryNotFoundException('Package with ID "' . $packageId . '" does not exist.'); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $this->configPersister->updateWith($satisConfig); |
204 | 204 | |
205 | - if($this->disableBuild === false) { |
|
205 | + if ($this->disableBuild === false) { |
|
206 | 206 | return $this->configBuilder->build(); |
207 | 207 | } |
208 | 208 | |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | public function __call($method, array $arguments) { |
242 | 242 | $method = $this->hiddenEntityPrefix . $method; |
243 | 243 | |
244 | - if(method_exists($this, $method)) { |
|
244 | + if (method_exists($this, $method)) { |
|
245 | 245 | $logger = $this->getLogger(); |
246 | 246 | |
247 | 247 | $logger->info(str_repeat('=', 30)); |
248 | - $logger->info('Request => ' . \Request::method() . ' (' . $method .') => '. json_encode($arguments)); |
|
248 | + $logger->info('Request => ' . \Request::method() . ' (' . $method . ') => ' . json_encode($arguments)); |
|
249 | 249 | |
250 | 250 | $type = str_plural(last(explode('_', snake_case($method))), 2); |
251 | 251 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | try { |
255 | 255 | $items = call_user_func_array([$this, $method], $arguments); |
256 | - } catch(\Exception $e) { |
|
256 | + } catch (\Exception $e) { |
|
257 | 257 | $logger->info('Response => ' . $e->getMessage()); |
258 | 258 | $logger->info(str_repeat('=', 30)); |
259 | 259 | |
@@ -273,9 +273,9 @@ discard block |
||
273 | 273 | * @return mixed |
274 | 274 | */ |
275 | 275 | public function __get($property) { |
276 | - $property = $this->hiddenEntityPrefix.$property; |
|
276 | + $property = $this->hiddenEntityPrefix . $property; |
|
277 | 277 | |
278 | - if(isset($this->lazyLoadedProperties[$property])) { |
|
278 | + if (isset($this->lazyLoadedProperties[$property])) { |
|
279 | 279 | $this->{$property} = $this->{$this->lazyLoadedProperties[$property]}(); |
280 | 280 | |
281 | 281 | unset($this->lazyLoadedProperties[$property]); |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | public function getRepositories($repositoryId = null) { |
303 | 303 | $repositoryCollection = $this->satis->getRepositories(); |
304 | 304 | |
305 | - if($repositoryId !== null) { |
|
306 | - if(!$repositoryCollection->has($repositoryId)) { |
|
305 | + if ($repositoryId !== null) { |
|
306 | + if (!$repositoryCollection->has($repositoryId)) { |
|
307 | 307 | throw new RepositoryNotFoundException('Repository with ID "' . $repositoryId . '" does not exist.'); |
308 | 308 | } |
309 | 309 | |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | public function getPackages($packageId = null) { |
324 | 324 | $packageCollection = $this->satis->getPackages(); |
325 | 325 | |
326 | - if($packageId !== null) { |
|
327 | - if(!$packageCollection->has($packageId)) { |
|
326 | + if ($packageId !== null) { |
|
327 | + if (!$packageCollection->has($packageId)) { |
|
328 | 328 | throw new PackageNotFoundException('Package with ID "' . $packageId . '" does not exist.'); |
329 | 329 | } |
330 | 330 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | * @param \App\Satis\BuildContext $buildContext |
341 | 341 | */ |
342 | 342 | public function forceBuild(BuildContext $buildContext) { |
343 | - if($buildContext->getItemName() !== null) { |
|
343 | + if ($buildContext->getItemName() !== null) { |
|
344 | 344 | $buildContext->setItemId(self::nameToId($buildContext->getItemName())); |
345 | 345 | } |
346 | 346 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException |
27 | 27 | */ |
28 | 28 | protected function getLockFile() { |
29 | - if($this->filesystem->exists($this->lockFilename)) { |
|
29 | + if ($this->filesystem->exists($this->lockFilename)) { |
|
30 | 30 | $configLock = $this->serializer->deserialize( |
31 | 31 | $this->filesystem->get($this->lockFilename), |
32 | 32 | 'App\Satis\Model\ConfigLock', |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function lock($repositoryId) { |
79 | 79 | $lockedRepositories = $this->getLockedRepositories(); |
80 | 80 | |
81 | - if(!is_null($repositoryId) && !$lockedRepositories->contains($repositoryId)) { |
|
81 | + if (!is_null($repositoryId) && !$lockedRepositories->contains($repositoryId)) { |
|
82 | 82 | $lockedRepositories->push($repositoryId); |
83 | 83 | } |
84 | 84 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public function unlock($repositoryId = null) { |
100 | 100 | $lockedRepositories = $this->getLockedRepositories(); |
101 | 101 | |
102 | - if($repositoryId !== null && $lockedRepositories->contains($repositoryId)) { |
|
102 | + if ($repositoryId !== null && $lockedRepositories->contains($repositoryId)) { |
|
103 | 103 | $lockedRepositories = $lockedRepositories->filter(function($id) use($repositoryId) { |
104 | 104 | return $id !== $repositoryId; |
105 | 105 | }); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * @return $this |
36 | 36 | */ |
37 | 37 | public function isLocked($locked = null) { |
38 | - if($locked === null) { |
|
38 | + if ($locked === null) { |
|
39 | 39 | return $this->locked; |
40 | 40 | } |
41 | 41 |