@@ -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 { |
@@ -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 | } |
@@ -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' => [], |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @throws TransportException |
| 138 | 138 | * @throws TransportNotFoundException |
| 139 | 139 | */ |
| 140 | - public function requirePackage($signature, $latest_version=true, $provider_name='modx.com') |
|
| 140 | + public function requirePackage($signature, $latest_version = true, $provider_name = 'modx.com') |
|
| 141 | 141 | { |
| 142 | 142 | // partial signature like fred sent, so is this package installed? |
| 143 | 143 | $package_info = static::getVersionInfo($signature); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * @return bool |
| 209 | 209 | * @throws TransportException |
| 210 | 210 | */ |
| 211 | - public function removePackage($signature, $force=true) |
|
| 211 | + public function removePackage($signature, $force = true) |
|
| 212 | 212 | { |
| 213 | 213 | /** @var modTransportPackage $package */ |
| 214 | 214 | $package = $this->modx->getObject('transport.modTransportPackage', [ |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | * @return bool |
| 247 | 247 | * @throws TransportException |
| 248 | 248 | */ |
| 249 | - public function unInstallPackage($signature, $preexisting_mode=null) |
|
| 249 | + public function unInstallPackage($signature, $preexisting_mode = null) |
|
| 250 | 250 | { |
| 251 | 251 | /** @var modTransportPackage $package */ |
| 252 | 252 | $package = $this->modx->getObject('transport.modTransportPackage', [ |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | * @throws TransportNotFoundException |
| 289 | 289 | * @return bool|modTransportPackage |
| 290 | 290 | */ |
| 291 | - protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest=true) |
|
| 291 | + protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest = true) |
|
| 292 | 292 | { |
| 293 | 293 | $transfer_options = []; |
| 294 | 294 | |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | $this->possible_package_signatures = $provider->find(['query' => $parts['base']]); |
| 315 | 315 | |
| 316 | - throw new TransportNotFoundException('Failed to download package ' . $signature. |
|
| 316 | + throw new TransportNotFoundException('Failed to download package '.$signature. |
|
| 317 | 317 | ' from the '.$provider->get('name').' transport provider. Verify the signature and provider'); |
| 318 | 318 | } |
| 319 | 319 | |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $this->modx->cacheManager->refresh(); |
| 335 | 335 | |
| 336 | 336 | if (!$installed) { |
| 337 | - throw new TransportException('Failed to install package ' . $package->signature); |
|
| 337 | + throw new TransportException('Failed to install package '.$package->signature); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | $this->userInteractionHandler->tellUser('Extra '.$package->get('signature').' has been installed!', userInteractionHandler::MASSAGE_SUCCESS); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $packageArray['updated'] = ''; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - $packageArray['created']= utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
| 363 | + $packageArray['created'] = utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
| 364 | 364 | |
| 365 | 365 | if ($packageArray['installed'] == null || $packageArray['installed'] == '0000-00-00 00:00:00') { |
| 366 | 366 | $packageArray['installed'] = null; |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | 'count' => 0, |
| 381 | 381 | 'versions' => [] |
| 382 | 382 | ]; |
| 383 | - if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates',null,false)) { |
|
| 383 | + if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates', null, false)) { |
|
| 384 | 384 | $updateCacheKey = 'mgr/providers/updates/'.$package->get('provider').'/'.$package->get('signature'); |
| 385 | 385 | $updateCacheOptions = array( |
| 386 | 386 | xPDO::OPT_CACHE_KEY => $this->modx->cacheManager->getOption('cache_packages_key', null, 'packages'), |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | * @param string $name |
| 460 | 460 | * @return bool|modTransportProvider |
| 461 | 461 | */ |
| 462 | - protected function getProvider($name='modx.com') |
|
| 462 | + protected function getProvider($name = 'modx.com') |
|
| 463 | 463 | { |
| 464 | 464 | if (isset($this->provider_map[$name]) && $this->providerCache[$this->provider_map[$name]]) { |
| 465 | 465 | return $this->providerCache[$this->provider_map[$name]]; |