@@ -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 | } |