Skip to content

Commit

Permalink
chore(style): Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetan-hexadog committed Oct 24, 2020
1 parent 8257ca4 commit eabfdac
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
86 changes: 43 additions & 43 deletions src/ThemeInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,51 @@

class ThemeInstaller extends LibraryInstaller
{
/**
* {@inheritdoc}
*/
public function supports($packageType)
{
return $packageType === 'laravel-theme';
}
/**
* {@inheritdoc}
*/
public function supports($packageType)
{
return $packageType === 'laravel-theme';
}

/**
* {@inheritdoc}
*/
public function getInstallPath(PackageInterface $package)
{
return $this->getBaseInstallationPath() . DIRECTORY_SEPARATOR . $this->getThemeName($package);
}
/**
* {@inheritdoc}
*/
public function getInstallPath(PackageInterface $package)
{
return $this->getBaseInstallationPath() . DIRECTORY_SEPARATOR . $this->getThemeName($package);
}

/**
* Get the base path that the module should be installed into.
* Defaults to Modules/ and can be overridden in the module's composer.json.
* @return string
*/
protected function getBaseInstallationPath()
{
if ($this->composer && $this->composer->getPackage()) {
$extra = $this->composer->getPackage()->getExtra();
/**
* Get the base path that the module should be installed into.
* Defaults to Modules/ and can be overridden in the module's composer.json.
* @return string
*/
protected function getBaseInstallationPath()
{
if ($this->composer && $this->composer->getPackage()) {
$extra = $this->composer->getPackage()->getExtra();

if (array_key_exists('theme-dir', $extra)) {
return $extra['theme-dir'];
}
}
if (array_key_exists('theme-dir', $extra)) {
return $extra['theme-dir'];
}
}

return 'themes';
}
/**
* Get the theme name
* "something" => "something"
* "vendor-name/something" => "something"
* "vendor-name/something-theme" => "something"
* @param PackageInterface $package
* @return string
* @throws \Exception
*/
protected function getThemeName(PackageInterface $package)
{
return str_replace('-theme', '', str_replace('theme-', '', $package->getPrettyName()));
}
return 'themes';
}
/**
* Get the theme name
* "something" => "something"
* "vendor-name/something" => "something"
* "vendor-name/something-theme" => "something"
* @param PackageInterface $package
* @return string
* @throws \Exception
*/
protected function getThemeName(PackageInterface $package)
{
return str_replace('-theme', '', str_replace('theme-', '', $package->getPrettyName()));
}
}
16 changes: 8 additions & 8 deletions src/ThemeInstallerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

class ThemeInstallerPlugin implements PluginInterface
{
/**
* {@inheritdoc}
*/
public function activate(Composer $composer, IOInterface $io)
{
$installer = new ThemeInstaller($io, $composer);
/**
* {@inheritdoc}
*/
public function activate(Composer $composer, IOInterface $io)
{
$installer = new ThemeInstaller($io, $composer);

$composer->getInstallationManager()->addInstaller($installer);
}
$composer->getInstallationManager()->addInstaller($installer);
}
}

0 comments on commit eabfdac

Please sign in to comment.