Skip to content

Commit

Permalink
Add override method attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 12, 2024
1 parent aa7ed43 commit a762400
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ includes:

parameters:
level: 4
checkMissingOverrideMethodAttribute: true
paths:
- .
excludePaths:
Expand Down
6 changes: 6 additions & 0 deletions src/ExtensionInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected function getRoundcubemailInstallPath(): string
return $this->roundcubemailInstallPath;
}

#[\Override]
public function getInstallPath(PackageInterface $package)
{
if (!$this->supports($package->getType())) {
Expand All @@ -87,13 +88,15 @@ private function initializeRoundcubemailEnvironment(): void
require_once INSTALL_PATH . 'program/include/iniset.php';
}

#[\Override]
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$this->setRoundcubemailInstallPath($repo);

return parent::isInstalled($repo, $package);
}

#[\Override]
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$this->setRoundcubemailInstallPath($repo);
Expand Down Expand Up @@ -155,6 +158,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
return null;
}

#[\Override]
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
$this->setRoundcubemailInstallPath($repo);
Expand Down Expand Up @@ -220,6 +224,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
return null;
}

#[\Override]
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$this->setRoundcubemailInstallPath($repo);
Expand Down Expand Up @@ -261,6 +266,7 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $
return null;
}

#[\Override]
public function supports($packageType)
{
return $packageType === $this->composer_type;
Expand Down
3 changes: 3 additions & 0 deletions src/PluginInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ class PluginInstaller extends ExtensionInstaller
{
protected $composer_type = 'roundcube-plugin';

#[\Override]
public function getVendorDir()
{
return $this->getRoundcubemailInstallPath() . \DIRECTORY_SEPARATOR . 'plugins';
}

#[\Override]
protected function confirmInstall($package_name)
{
$config = $this->composer->getConfig()->get('roundcube');
Expand All @@ -24,6 +26,7 @@ protected function confirmInstall($package_name)
return $answer;
}

#[\Override]
protected function getConfig($package_name, $config, $add)
{
$cur_config = !empty($config['plugins'])
Expand Down
3 changes: 3 additions & 0 deletions src/RoundcubeInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class RoundcubeInstaller implements PluginInterface
private $extentions = [PluginInstaller::class, SkinInstaller::class];
private $installers = [];

#[\Override]
public function activate(Composer $composer, IOInterface $io)
{
foreach ($this->extentions as $extension) {
Expand All @@ -20,12 +21,14 @@ public function activate(Composer $composer, IOInterface $io)
}
}

#[\Override]
public function deactivate(Composer $composer, IOInterface $io)
{
foreach ($this->installers as $installer) {
$composer->getInstallationManager()->removeInstaller($installer);
}
}

#[\Override]
public function uninstall(Composer $composer, IOInterface $io) {}
}
3 changes: 3 additions & 0 deletions src/SkinInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ class SkinInstaller extends ExtensionInstaller
{
protected $composer_type = 'roundcube-skin';

#[\Override]
public function getVendorDir()
{
return $this->getRoundcubemailInstallPath() . \DIRECTORY_SEPARATOR . 'skins';
}

#[\Override]
protected function confirmInstall($package_name)
{
$config = $this->composer->getConfig()->get('roundcube');
Expand All @@ -24,6 +26,7 @@ protected function confirmInstall($package_name)
return $answer;
}

#[\Override]
protected function getConfig($package_name, $config, $add)
{
$cur_config = !empty($config['skin'])
Expand Down

0 comments on commit a762400

Please sign in to comment.