@@ -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 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param string $search |
73 | 73 | * @return array |
74 | 74 | */ |
75 | - public function getList($limit=25, $start=0, $search='') { |
|
75 | + public function getList($limit = 25, $start = 0, $search = '') { |
|
76 | 76 | $data = [ |
77 | 77 | 'limit' => $limit, |
78 | 78 | 'packages' => [], |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @return bool |
139 | 139 | * @throws TransportException |
140 | 140 | */ |
141 | - public function unInstallPackage($signature, $preexisting_mode=xPDOTransport::REMOVE_PREEXISTING) |
|
141 | + public function unInstallPackage($signature, $preexisting_mode = xPDOTransport::REMOVE_PREEXISTING) |
|
142 | 142 | { |
143 | 143 | $package = $this->modx->getObject('transport.modTransportPackage', [ |
144 | 144 | 'signature' => $signature, |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @throws TransportException |
170 | 170 | * @throws TransportNotFoundException |
171 | 171 | */ |
172 | - public function requirePackage($signature, $latest_version=true, $provider_name='modx.com') |
|
172 | + public function requirePackage($signature, $latest_version = true, $provider_name = 'modx.com') |
|
173 | 173 | { |
174 | 174 | // partial signature like fred sent, so is this package installed? |
175 | 175 | $package_info = static::getVersionInfo($signature); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | * @throws TransportNotFoundException |
241 | 241 | * @return bool|modTransportPackage |
242 | 242 | */ |
243 | - protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest=true) |
|
243 | + protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest = true) |
|
244 | 244 | { |
245 | 245 | $transfer_options = []; |
246 | 246 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | |
266 | 266 | $this->possible_package_signatures = $provider->find(['query' => $parts['base']]); |
267 | 267 | |
268 | - throw new TransportNotFoundException('Failed to download package ' . $signature. |
|
268 | + throw new TransportNotFoundException('Failed to download package '.$signature. |
|
269 | 269 | ' from the '.$provider->get('name').' transport provider. Verify the signature and provider'); |
270 | 270 | } |
271 | 271 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $this->modx->cacheManager->refresh(); |
285 | 285 | |
286 | 286 | if (!$installed) { |
287 | - throw new TransportException('Failed to install package ' . $package->signature); |
|
287 | + throw new TransportException('Failed to install package '.$package->signature); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | $this->userInteractionHandler->tellUser('Extra '.$package->get('signature').' has been installed!', userInteractionHandler::MASSAGE_ERROR); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $packageArray['updated'] = ''; |
311 | 311 | } |
312 | 312 | |
313 | - $packageArray['created']= utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
313 | + $packageArray['created'] = utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
314 | 314 | |
315 | 315 | if ($packageArray['installed'] == null || $packageArray['installed'] == '0000-00-00 00:00:00') { |
316 | 316 | $packageArray['installed'] = null; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | 'count' => 0, |
331 | 331 | 'versions' => [] |
332 | 332 | ]; |
333 | - if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates',null,false)) { |
|
333 | + if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates', null, false)) { |
|
334 | 334 | $updateCacheKey = 'mgr/providers/updates/'.$package->get('provider').'/'.$package->get('signature'); |
335 | 335 | $updateCacheOptions = array( |
336 | 336 | xPDO::OPT_CACHE_KEY => $this->modx->cacheManager->getOption('cache_packages_key', null, 'packages'), |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | * @param string $name |
410 | 410 | * @return bool|modTransportProvider |
411 | 411 | */ |
412 | - protected function getProvider($name='modx.com') |
|
412 | + protected function getProvider($name = 'modx.com') |
|
413 | 413 | { |
414 | 414 | if (isset($this->provider_map[$name]) && $this->providerCache[$this->provider_map[$name]]) { |
415 | 415 | return $this->providerCache[$this->provider_map[$name]]; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param bool $latest_version |
26 | 26 | * @param string $provider_name |
27 | 27 | */ |
28 | - public static function addPackageConfig($signature, $latest_version=true, $provider_name='modx.com') |
|
28 | + public static function addPackageConfig($signature, $latest_version = true, $provider_name = 'modx.com') |
|
29 | 29 | { |
30 | 30 | static::loadMODXTransportPackageInfo(); |
31 | 31 | $package_parts = MODXPackages::getVersionInfo($signature); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | if (!static::$packages) { |
95 | 95 | static::$packages = []; |
96 | 96 | |
97 | - static::$package_file = $console->getConfigFilePaths()['config_dir'] . 'lci_modx_transport_package.php'; |
|
97 | + static::$package_file = $console->getConfigFilePaths()['config_dir'].'lci_modx_transport_package.php'; |
|
98 | 98 | |
99 | 99 | if (file_exists(static::$package_file)) { |
100 | 100 | static::$packages = include static::$package_file; |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | */ |
109 | 109 | protected static function writeCacheFile($file, $data) |
110 | 110 | { |
111 | - $content = '<?php ' . PHP_EOL . |
|
112 | - 'return ' . var_export($data, true) . ';'; |
|
111 | + $content = '<?php '.PHP_EOL. |
|
112 | + 'return '.var_export($data, true).';'; |
|
113 | 113 | |
114 | 114 | file_put_contents($file, $content); |
115 | 115 | } |