@@ -35,7 +35,7 @@ |
||
35 | 35 | public function getLocations() |
36 | 36 | { |
37 | 37 | if ($this->matchesCakeVersion('>=', '3.0.0')) { |
38 | - $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/'; |
|
38 | + $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/'; |
|
39 | 39 | } |
40 | 40 | return $this->locations; |
41 | 41 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | class OxidInstaller extends BaseInstaller |
7 | 7 | { |
8 | - const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/'; |
|
8 | + const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/'; |
|
9 | 9 | |
10 | 10 | protected $locations = array( |
11 | 11 | 'module' => 'modules/{$name}/', |
@@ -13,47 +13,47 @@ discard block |
||
13 | 13 | 'out' => 'out/{$name}/', |
14 | 14 | ); |
15 | 15 | |
16 | - /** |
|
17 | - * getInstallPath |
|
18 | - * |
|
19 | - * @param PackageInterface $package |
|
20 | - * @param string $frameworkType |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function getInstallPath(PackageInterface $package, $frameworkType = '') |
|
24 | - { |
|
25 | - $installPath = parent::getInstallPath($package, $frameworkType); |
|
26 | - $type = $this->package->getType(); |
|
27 | - if ($type === 'oxid-module') { |
|
28 | - $this->prepareVendorDirectory($installPath); |
|
29 | - } |
|
30 | - return $installPath; |
|
31 | - } |
|
16 | + /** |
|
17 | + * getInstallPath |
|
18 | + * |
|
19 | + * @param PackageInterface $package |
|
20 | + * @param string $frameworkType |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function getInstallPath(PackageInterface $package, $frameworkType = '') |
|
24 | + { |
|
25 | + $installPath = parent::getInstallPath($package, $frameworkType); |
|
26 | + $type = $this->package->getType(); |
|
27 | + if ($type === 'oxid-module') { |
|
28 | + $this->prepareVendorDirectory($installPath); |
|
29 | + } |
|
30 | + return $installPath; |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * prepareVendorDirectory |
|
35 | - * |
|
36 | - * Makes sure there is a vendormetadata.php file inside |
|
37 | - * the vendor folder if there is a vendor folder. |
|
38 | - * |
|
39 | - * @param string $installPath |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - protected function prepareVendorDirectory($installPath) |
|
43 | - { |
|
44 | - $matches = ''; |
|
45 | - $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches); |
|
46 | - if (!$hasVendorDirectory) { |
|
47 | - return; |
|
48 | - } |
|
33 | + /** |
|
34 | + * prepareVendorDirectory |
|
35 | + * |
|
36 | + * Makes sure there is a vendormetadata.php file inside |
|
37 | + * the vendor folder if there is a vendor folder. |
|
38 | + * |
|
39 | + * @param string $installPath |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + protected function prepareVendorDirectory($installPath) |
|
43 | + { |
|
44 | + $matches = ''; |
|
45 | + $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches); |
|
46 | + if (!$hasVendorDirectory) { |
|
47 | + return; |
|
48 | + } |
|
49 | 49 | |
50 | - $vendorDirectory = $matches['vendor']; |
|
51 | - $vendorPath = getcwd() . '/modules/' . $vendorDirectory; |
|
52 | - if (!file_exists($vendorPath)) { |
|
53 | - mkdir($vendorPath, 0755, true); |
|
54 | - } |
|
50 | + $vendorDirectory = $matches['vendor']; |
|
51 | + $vendorPath = getcwd() . '/modules/' . $vendorDirectory; |
|
52 | + if (!file_exists($vendorPath)) { |
|
53 | + mkdir($vendorPath, 0755, true); |
|
54 | + } |
|
55 | 55 | |
56 | - $vendorMetaDataPath = $vendorPath . '/vendormetadata.php'; |
|
57 | - touch($vendorMetaDataPath); |
|
58 | - } |
|
56 | + $vendorMetaDataPath = $vendorPath . '/vendormetadata.php'; |
|
57 | + touch($vendorMetaDataPath); |
|
58 | + } |
|
59 | 59 | } |
@@ -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 | ); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | |
4 | 4 | class ClanCatsFrameworkInstaller extends BaseInstaller |
5 | 5 | { |
6 | - protected $locations = array( |
|
7 | - 'ship' => 'CCF/orbit/{$name}/', |
|
8 | - 'theme' => 'CCF/app/themes/{$name}/', |
|
9 | - ); |
|
6 | + protected $locations = array( |
|
7 | + 'ship' => 'CCF/orbit/{$name}/', |
|
8 | + 'theme' => 'CCF/app/themes/{$name}/', |
|
9 | + ); |
|
10 | 10 | } |
11 | 11 | \ No newline at end of file |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function inflectPackageVars($vars) |
15 | 15 | { |
16 | 16 | if ($vars['type'] == 'mautic-plugin') { |
17 | - $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) { |
|
17 | + $vars['name'] = preg_replace_callback('/(-[a-z])/', function($matches) { |
|
18 | 18 | return strtoupper($matches[0][1]); |
19 | 19 | }, ucfirst($vars['name'])); |
20 | 20 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | unset($vars['name'][$key]); |
23 | 23 | } |
24 | 24 | } |
25 | - $vars['name'] = implode("",$vars['name']); |
|
25 | + $vars['name'] = implode("", $vars['name']); |
|
26 | 26 | |
27 | 27 | return $vars; |
28 | 28 | } |
@@ -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); |
@@ -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 |
@@ -215,7 +215,7 @@ |
||
215 | 215 | $pattern = $locations ? '(' . implode('|', $locations) . ')' : false; |
216 | 216 | } |
217 | 217 | |
218 | - return $pattern ? : '(\w+)'; |
|
218 | + return $pattern ?: '(\w+)'; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |