@@ -20,5 +20,5 @@ |
||
20 | 20 | /** |
21 | 21 | * @return array |
22 | 22 | */ |
23 | - public function getInputProperties(): array ; |
|
23 | + public function getInputProperties(): array; |
|
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param string $separator ~ the separator between items |
23 | 23 | * @param string $value_separator ~ the separator between label and value |
24 | 24 | */ |
25 | - public function __construct(string $separator='||', string $value_separator='==') |
|
25 | + public function __construct(string $separator = '||', string $value_separator = '==') |
|
26 | 26 | { |
27 | 27 | $this->separator = $separator; |
28 | 28 | $this->value_separator = $value_separator; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if (!empty($string)) { |
39 | 39 | $string .= $this->separator; |
40 | 40 | } |
41 | - $string .= $label . $this->value_separator . $value; |
|
41 | + $string .= $label.$this->value_separator.$value; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | return $string; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param null $value |
58 | 58 | * @return $this |
59 | 59 | */ |
60 | - public function setOption(string $label, $value=null): self |
|
60 | + public function setOption(string $label, $value = null): self |
|
61 | 61 | { |
62 | 62 | if (is_null($value)) { |
63 | 63 | $value = $label; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param string $type |
108 | 108 | * @return MIGXTemplateVariableInput |
109 | 109 | */ |
110 | - public function getMIGXInputPropertyHelper(string $type='migx') |
|
110 | + public function getMIGXInputPropertyHelper(string $type = 'migx') |
|
111 | 111 | { |
112 | 112 | $this->setFieldType($type); |
113 | 113 | return new MIGXTemplateVariableInput($this->getFieldType()); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @param string $context - default is web |
223 | 223 | * @return $this |
224 | 224 | */ |
225 | - public function setMediaSource($name = 'Filesystem', $context='web') |
|
225 | + public function setMediaSource($name = 'Filesystem', $context = 'web') |
|
226 | 226 | { |
227 | 227 | $this->media_sources[$name] = $context; |
228 | 228 | if ($context == 'web') { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $modMediaSourceElement->set('source', $this->convertSource($name)); |
337 | 337 | |
338 | 338 | if (!$modMediaSourceElement->save()) { |
339 | - $this->blender->out('Template variable ' .$this->xPDOSimpleObject->get('name'). |
|
339 | + $this->blender->out('Template variable '.$this->xPDOSimpleObject->get('name'). |
|
340 | 340 | 'did not attached the media source: '.$name); |
341 | 341 | } |
342 | 342 | } |
@@ -517,8 +517,8 @@ discard block |
||
517 | 517 | { |
518 | 518 | if ($this->unique_key_length_limit > 0 && is_string($criteria) && strlen($criteria) > $this->unique_key_length_limit) { |
519 | 519 | throw new BlendableKeyLengthException( |
520 | - 'Error: '.$this->unique_key_column . ' is limited to '. |
|
521 | - $this->unique_key_length_limit .' and '.$criteria.' is '. strlen($criteria) . ' characters' |
|
520 | + 'Error: '.$this->unique_key_column.' is limited to '. |
|
521 | + $this->unique_key_length_limit.' and '.$criteria.' is '.strlen($criteria).' characters' |
|
522 | 522 | ); |
523 | 523 | } |
524 | 524 | |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | if ($data == false) { |
622 | 622 | if ($this->type == 'blend') { |
623 | 623 | $this->blender->outError('Error: Seed could not be found: '.$seed_key); |
624 | - throw new BlendableException('Error: Seed could not be found: '.$seed_key . ' in '. print_r($this->seedCacheOptions, true)); |
|
624 | + throw new BlendableException('Error: Seed could not be found: '.$seed_key.' in '.print_r($this->seedCacheOptions, true)); |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | $this->userInteractionHandler = $userInteractionHandler; |
46 | 46 | |
47 | - $this->date_format = $this->modx->getOption('manager_date_format') .', '. $this->modx->getOption('manager_time_format'); |
|
47 | + $this->date_format = $this->modx->getOption('manager_date_format').', '.$this->modx->getOption('manager_time_format'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Code ideas for MODX packages from: core/model/modx/processors/workspace/packages/getlist.class.php and |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param string $search |
57 | 57 | * @return array |
58 | 58 | */ |
59 | - public function getList($limit=25, $start=0, $search='') { |
|
59 | + public function getList($limit = 25, $start = 0, $search = '') { |
|
60 | 60 | $data = [ |
61 | 61 | 'limit' => $limit, |
62 | 62 | 'packages' => [], |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @return bool |
123 | 123 | * @throws TransportException |
124 | 124 | */ |
125 | - public function unInstallPackage($signature, $preexisting_mode=xPDOTransport::REMOVE_PREEXISTING) |
|
125 | + public function unInstallPackage($signature, $preexisting_mode = xPDOTransport::REMOVE_PREEXISTING) |
|
126 | 126 | { |
127 | 127 | $package = $this->modx->getObject('transport.modTransportPackage', [ |
128 | 128 | 'signature' => $signature, |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @throws TransportException |
154 | 154 | * @throws TransportNotFoundException |
155 | 155 | */ |
156 | - public function requirePackage($signature, $latest_version=true, $provider_name='modx.com') |
|
156 | + public function requirePackage($signature, $latest_version = true, $provider_name = 'modx.com') |
|
157 | 157 | { |
158 | 158 | $package = $this->modx->getObject('transport.modTransportPackage', [ |
159 | 159 | 'signature' => $signature, |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @throws TransportNotFoundException |
218 | 218 | * @return bool|modTransportPackage |
219 | 219 | */ |
220 | - protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest=true) |
|
220 | + protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest = true) |
|
221 | 221 | { |
222 | 222 | $transfer_options = []; |
223 | 223 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | $this->possible_package_signatures = $provider->find(['query' => $parts['base']]); |
244 | 244 | |
245 | - throw new TransportNotFoundException('Failed to download package ' . $signature. |
|
245 | + throw new TransportNotFoundException('Failed to download package '.$signature. |
|
246 | 246 | ' from the '.$provider->get('name').' transport provider. Verify the signature and provider'); |
247 | 247 | } |
248 | 248 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $this->modx->cacheManager->refresh(); |
262 | 262 | |
263 | 263 | if (!$installed) { |
264 | - throw new TransportException('Failed to install package ' . $package->signature); |
|
264 | + throw new TransportException('Failed to install package '.$package->signature); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | $this->userInteractionHandler->tellUser('Extra '.$package->get('signature').' has been installed!', userInteractionHandler::MASSAGE_ERROR); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $packageArray['updated'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - $packageArray['created']= utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
306 | + $packageArray['created'] = utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
307 | 307 | |
308 | 308 | if ($packageArray['installed'] == null || $packageArray['installed'] == '0000-00-00 00:00:00') { |
309 | 309 | $packageArray['installed'] = null; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | 'count' => 0, |
324 | 324 | 'versions' => [] |
325 | 325 | ]; |
326 | - if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates',null,false)) { |
|
326 | + if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates', null, false)) { |
|
327 | 327 | $updateCacheKey = 'mgr/providers/updates/'.$package->get('provider').'/'.$package->get('signature'); |
328 | 328 | $updateCacheOptions = array( |
329 | 329 | xPDO::OPT_CACHE_KEY => $this->modx->cacheManager->getOption('cache_packages_key', null, 'packages'), |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | * @param string $name |
402 | 402 | * @return bool|modTransportProvider |
403 | 403 | */ |
404 | - protected function getProvider($name='modx.com') |
|
404 | + protected function getProvider($name = 'modx.com') |
|
405 | 405 | { |
406 | 406 | if (isset($this->provider_map[$name]) && $this->providerCache[$this->provider_map[$name]]) { |
407 | 407 | return $this->providerCache[$this->provider_map[$name]]; |