|
7 | 7 |
|
8 | 8 | class ThemeInstaller extends LibraryInstaller
|
9 | 9 | {
|
10 |
| - /** |
11 |
| - * {@inheritdoc} |
12 |
| - */ |
13 |
| - public function supports($packageType) |
14 |
| - { |
15 |
| - return $packageType === 'laravel-theme'; |
16 |
| - } |
| 10 | + /** |
| 11 | + * {@inheritdoc} |
| 12 | + */ |
| 13 | + public function supports($packageType) |
| 14 | + { |
| 15 | + return $packageType === 'laravel-theme'; |
| 16 | + } |
17 | 17 |
|
18 |
| - /** |
19 |
| - * {@inheritdoc} |
20 |
| - */ |
21 |
| - public function getInstallPath(PackageInterface $package) |
22 |
| - { |
23 |
| - return $this->getBaseInstallationPath() . DIRECTORY_SEPARATOR . $this->getThemeName($package); |
24 |
| - } |
| 18 | + /** |
| 19 | + * {@inheritdoc} |
| 20 | + */ |
| 21 | + public function getInstallPath(PackageInterface $package) |
| 22 | + { |
| 23 | + return $this->getBaseInstallationPath() . DIRECTORY_SEPARATOR . $this->getThemeName($package); |
| 24 | + } |
25 | 25 |
|
26 |
| - /** |
27 |
| - * Get the base path that the module should be installed into. |
28 |
| - * Defaults to Modules/ and can be overridden in the module's composer.json. |
29 |
| - * @return string |
30 |
| - */ |
31 |
| - protected function getBaseInstallationPath() |
32 |
| - { |
33 |
| - if ($this->composer && $this->composer->getPackage()) { |
34 |
| - $extra = $this->composer->getPackage()->getExtra(); |
| 26 | + /** |
| 27 | + * Get the base path that the module should be installed into. |
| 28 | + * Defaults to Modules/ and can be overridden in the module's composer.json. |
| 29 | + * @return string |
| 30 | + */ |
| 31 | + protected function getBaseInstallationPath() |
| 32 | + { |
| 33 | + if ($this->composer && $this->composer->getPackage()) { |
| 34 | + $extra = $this->composer->getPackage()->getExtra(); |
35 | 35 |
|
36 |
| - if (array_key_exists('theme-dir', $extra)) { |
37 |
| - return $extra['theme-dir']; |
38 |
| - } |
39 |
| - } |
| 36 | + if (array_key_exists('theme-dir', $extra)) { |
| 37 | + return $extra['theme-dir']; |
| 38 | + } |
| 39 | + } |
40 | 40 |
|
41 |
| - return 'themes'; |
42 |
| - } |
43 |
| - |
44 |
| - /** |
45 |
| - * Get the theme name |
46 |
| - * "something" => "something" |
47 |
| - * "vendor-name/something" => "something" |
48 |
| - * "vendor-name/something-theme" => "something" |
49 |
| - * @param PackageInterface $package |
50 |
| - * @return string |
51 |
| - * @throws \Exception |
52 |
| - */ |
53 |
| - protected function getThemeName(PackageInterface $package) |
54 |
| - { |
55 |
| - return str_replace('-theme', '', str_replace('theme-', '', $package->getPrettyName())); |
56 |
| - } |
| 41 | + return 'themes'; |
| 42 | + } |
| 43 | + |
| 44 | + /** |
| 45 | + * Get the theme name |
| 46 | + * "something" => "something" |
| 47 | + * "vendor-name/something" => "something" |
| 48 | + * "vendor-name/something-theme" => "something" |
| 49 | + * @param PackageInterface $package |
| 50 | + * @return string |
| 51 | + * @throws \Exception |
| 52 | + */ |
| 53 | + protected function getThemeName(PackageInterface $package) |
| 54 | + { |
| 55 | + return str_replace('-theme', '', str_replace('theme-', '', $package->getPrettyName())); |
| 56 | + } |
57 | 57 | }
|
0 commit comments