@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | private function correctPluginName($vars) |
| 30 | 30 | { |
| 31 | - $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) { |
|
| 31 | + $camelCasedName = preg_replace_callback('/(-[a-z])/', function($matches) { |
|
| 32 | 32 | return strtoupper($matches[0][1]); |
| 33 | 33 | }, $vars['name']); |
| 34 | 34 | $vars['name'] = ucfirst($camelCasedName); |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | protected function inflectModuleVars($vars) |
| 37 | 37 | { |
| 38 | - $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
| 39 | - $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module- |
|
| 40 | - $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module |
|
| 41 | - $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
| 42 | - $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
| 38 | + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
| 39 | + $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module- |
|
| 40 | + $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module |
|
| 41 | + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
| 42 | + $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
| 43 | 43 | |
| 44 | 44 | return $vars; |
| 45 | 45 | } |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | protected function inflectThemeVars($vars) |
| 54 | 54 | { |
| 55 | - $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
| 56 | - $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme- |
|
| 57 | - $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme |
|
| 58 | - $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
| 59 | - $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
| 55 | + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) |
|
| 56 | + $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme- |
|
| 57 | + $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme |
|
| 58 | + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s |
|
| 59 | + $vars['name'] = ucwords($vars['name']); // make module name camelcased |
|
| 60 | 60 | |
| 61 | 61 | return $vars; |
| 62 | 62 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $restrictedWords = implode('|', array_keys($this->locations)); |
| 21 | 21 | |
| 22 | 22 | $vars['name'] = strtolower($vars['name']); |
| 23 | - $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui', |
|
| 23 | + $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:' . $restrictedWords . ')-)?(.*?)(?:-(?:' . $restrictedWords . '))?$/ui', |
|
| 24 | 24 | '$1', |
| 25 | 25 | $vars['name'] |
| 26 | 26 | ); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function inflectPackageVars($vars) |
| 14 | 14 | { |
| 15 | - $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) { |
|
| 15 | + $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function($matches) { |
|
| 16 | 16 | return strtoupper($matches[1]); |
| 17 | 17 | }, $vars['name']); |
| 18 | 18 | |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function inflectPackageVars($vars) |
| 19 | 19 | { |
| 20 | - $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) { |
|
| 20 | + $vars['name'] = preg_replace_callback('/(-[a-z])/', function($matches) { |
|
| 21 | 21 | return strtoupper($matches[0][1]); |
| 22 | 22 | }, $vars['name']); |
| 23 | 23 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | private function correctPluginName($vars) |
| 39 | 39 | { |
| 40 | - $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) { |
|
| 40 | + $camelCasedName = preg_replace_callback('/(-[a-z])/', function($matches) { |
|
| 41 | 41 | return strtoupper($matches[0][1]); |
| 42 | 42 | }, $vars['name']); |
| 43 | 43 | |
@@ -26,9 +26,9 @@ |
||
| 26 | 26 | class BitrixInstaller extends BaseInstaller |
| 27 | 27 | { |
| 28 | 28 | protected $locations = array( |
| 29 | - 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
| 29 | + 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
| 30 | 30 | 'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
| 31 | - 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
| 31 | + 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) |
|
| 32 | 32 | 'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/', |
| 33 | 33 | 'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/', |
| 34 | 34 | 'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/', |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function getLocations() |
| 37 | 37 | { |
| 38 | 38 | if ($this->matchesCakeVersion('>=', '3.0.0')) { |
| 39 | - $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/'; |
|
| 39 | + $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/'; |
|
| 40 | 40 | } |
| 41 | 41 | return $this->locations; |
| 42 | 42 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | protected function matchesCakeVersion($matcher, $version) |
| 53 | 53 | { |
| 54 | 54 | $repositoryManager = $this->composer->getRepositoryManager(); |
| 55 | - if (! $repositoryManager) { |
|
| 55 | + if (!$repositoryManager) { |
|
| 56 | 56 | return false; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | { |
| 170 | 170 | $installPath = $this->getPackageBasePath($package); |
| 171 | 171 | $io = $this->io; |
| 172 | - $outputStatus = function () use ($io, $installPath) { |
|
| 172 | + $outputStatus = function() use ($io, $installPath) { |
|
| 173 | 173 | $io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>')); |
| 174 | 174 | }; |
| 175 | 175 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $pattern = $locations ? '(' . implode('|', $locations) . ')' : false; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - return $pattern ? : '(\w+)'; |
|
| 242 | + return $pattern ?: '(\w+)'; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |