@@ -367,6 +367,10 @@ |
||
367 | 367 | return $file; |
368 | 368 | } |
369 | 369 | |
370 | + /** |
|
371 | + * @param string $class |
|
372 | + * @param string $ext |
|
373 | + */ |
|
370 | 374 | private function findFileWithExtension($class, $ext) |
371 | 375 | { |
372 | 376 | // PSR-4 lookup |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | if (!$prefix) { |
112 | 112 | if ($prepend) { |
113 | 113 | $this->fallbackDirsPsr0 = array_merge( |
114 | - (array) $paths, |
|
114 | + (array)$paths, |
|
115 | 115 | $this->fallbackDirsPsr0 |
116 | 116 | ); |
117 | 117 | } else { |
118 | 118 | $this->fallbackDirsPsr0 = array_merge( |
119 | 119 | $this->fallbackDirsPsr0, |
120 | - (array) $paths |
|
120 | + (array)$paths |
|
121 | 121 | ); |
122 | 122 | } |
123 | 123 | |
@@ -126,19 +126,19 @@ discard block |
||
126 | 126 | |
127 | 127 | $first = $prefix[0]; |
128 | 128 | if (!isset($this->prefixesPsr0[$first][$prefix])) { |
129 | - $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
|
129 | + $this->prefixesPsr0[$first][$prefix] = (array)$paths; |
|
130 | 130 | |
131 | 131 | return; |
132 | 132 | } |
133 | 133 | if ($prepend) { |
134 | 134 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
135 | - (array) $paths, |
|
135 | + (array)$paths, |
|
136 | 136 | $this->prefixesPsr0[$first][$prefix] |
137 | 137 | ); |
138 | 138 | } else { |
139 | 139 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
140 | 140 | $this->prefixesPsr0[$first][$prefix], |
141 | - (array) $paths |
|
141 | + (array)$paths |
|
142 | 142 | ); |
143 | 143 | } |
144 | 144 | } |
@@ -159,13 +159,13 @@ discard block |
||
159 | 159 | // Register directories for the root namespace. |
160 | 160 | if ($prepend) { |
161 | 161 | $this->fallbackDirsPsr4 = array_merge( |
162 | - (array) $paths, |
|
162 | + (array)$paths, |
|
163 | 163 | $this->fallbackDirsPsr4 |
164 | 164 | ); |
165 | 165 | } else { |
166 | 166 | $this->fallbackDirsPsr4 = array_merge( |
167 | 167 | $this->fallbackDirsPsr4, |
168 | - (array) $paths |
|
168 | + (array)$paths |
|
169 | 169 | ); |
170 | 170 | } |
171 | 171 | } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
@@ -175,18 +175,18 @@ discard block |
||
175 | 175 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
176 | 176 | } |
177 | 177 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
178 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
178 | + $this->prefixDirsPsr4[$prefix] = (array)$paths; |
|
179 | 179 | } elseif ($prepend) { |
180 | 180 | // Prepend directories for an already registered namespace. |
181 | 181 | $this->prefixDirsPsr4[$prefix] = array_merge( |
182 | - (array) $paths, |
|
182 | + (array)$paths, |
|
183 | 183 | $this->prefixDirsPsr4[$prefix] |
184 | 184 | ); |
185 | 185 | } else { |
186 | 186 | // Append directories for an already registered namespace. |
187 | 187 | $this->prefixDirsPsr4[$prefix] = array_merge( |
188 | 188 | $this->prefixDirsPsr4[$prefix], |
189 | - (array) $paths |
|
189 | + (array)$paths |
|
190 | 190 | ); |
191 | 191 | } |
192 | 192 | } |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | public function set($prefix, $paths) |
202 | 202 | { |
203 | 203 | if (!$prefix) { |
204 | - $this->fallbackDirsPsr0 = (array) $paths; |
|
204 | + $this->fallbackDirsPsr0 = (array)$paths; |
|
205 | 205 | } else { |
206 | - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
|
206 | + $this->prefixesPsr0[$prefix[0]][$prefix] = (array)$paths; |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
@@ -219,14 +219,14 @@ discard block |
||
219 | 219 | public function setPsr4($prefix, $paths) |
220 | 220 | { |
221 | 221 | if (!$prefix) { |
222 | - $this->fallbackDirsPsr4 = (array) $paths; |
|
222 | + $this->fallbackDirsPsr4 = (array)$paths; |
|
223 | 223 | } else { |
224 | 224 | $length = strlen($prefix); |
225 | 225 | if ('\\' !== $prefix[$length - 1]) { |
226 | 226 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
227 | 227 | } |
228 | 228 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
229 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
229 | + $this->prefixDirsPsr4[$prefix] = (array)$paths; |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | return false; |
343 | 343 | } |
344 | 344 | if (null !== $this->apcuPrefix) { |
345 | - $file = apcu_fetch($this->apcuPrefix.$class, $hit); |
|
345 | + $file = apcu_fetch($this->apcuPrefix . $class, $hit); |
|
346 | 346 | if ($hit) { |
347 | 347 | return $file; |
348 | 348 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | if (null !== $this->apcuPrefix) { |
359 | - apcu_add($this->apcuPrefix.$class, $file); |
|
359 | + apcu_add($this->apcuPrefix . $class, $file); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | if (false === $file) { |
@@ -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 |