diff --git a/composer.json b/composer.json index 8520aa2168..513ccfdbbf 100644 --- a/composer.json +++ b/composer.json @@ -66,6 +66,7 @@ "friends-of-behat/mink-extension": "^2.4", "ibexa/ci-scripts": "^0.2@dev", "ibexa/code-style": "~2.0.0", + "ibexa/rector": "dev-ibx-8224-drop-interface-with-methods", "jenner/simple_fork": "^1.2", "matthiasnoback/symfony-dependency-injection-test": "^4.1", "phpstan/phpstan": "^1.2", diff --git a/src/bundle/Core/Command/CheckURLsCommand.php b/src/bundle/Core/Command/CheckURLsCommand.php index b9b5b3ee26..924b6a366c 100644 --- a/src/bundle/Core/Command/CheckURLsCommand.php +++ b/src/bundle/Core/Command/CheckURLsCommand.php @@ -22,7 +22,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class CheckURLsCommand extends Command implements BackwardCompatibleCommand +class CheckURLsCommand extends Command { private const DEFAULT_ITERATION_COUNT = 50; private const DEFAULT_REPOSITORY_USER = 'admin'; @@ -118,9 +118,4 @@ private function getTotalCount(): int return $this->urlService->findUrls($query)->totalCount; } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:check-urls']; - } } diff --git a/src/bundle/Core/Command/CleanupVersionsCommand.php b/src/bundle/Core/Command/CleanupVersionsCommand.php index cec0bffd7b..fb937fdf8c 100644 --- a/src/bundle/Core/Command/CleanupVersionsCommand.php +++ b/src/bundle/Core/Command/CleanupVersionsCommand.php @@ -20,11 +20,10 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class CleanupVersionsCommand extends Command implements BackwardCompatibleCommand +class CleanupVersionsCommand extends Command { public const DEFAULT_REPOSITORY_USER = 'admin'; public const DEFAULT_EXCLUDED_CONTENT_TYPES = 'user'; - public const BEFORE_RUNNING_HINTS = <<Before you continue: - Make sure to back up your database. @@ -32,12 +31,10 @@ class CleanupVersionsCommand extends Command implements BackwardCompatibleComman - Run this command without memory limit. - Run this command in production environment using --env=prod EOT; - public const VERSION_DRAFT = 'draft'; public const VERSION_ARCHIVED = 'archived'; public const VERSION_PUBLISHED = 'published'; public const VERSION_ALL = 'all'; - public const VERSION_STATUS = [ self::VERSION_DRAFT => VersionInfo::STATUS_DRAFT, self::VERSION_ARCHIVED => VersionInfo::STATUS_ARCHIVED, @@ -301,9 +298,4 @@ private function mapStatusToVersionInfoStatus($status) ) ); } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:content:cleanup-versions']; - } } diff --git a/src/bundle/Core/Command/CopySubtreeCommand.php b/src/bundle/Core/Command/CopySubtreeCommand.php index 3e2c00c2da..2a88492e64 100644 --- a/src/bundle/Core/Command/CopySubtreeCommand.php +++ b/src/bundle/Core/Command/CopySubtreeCommand.php @@ -26,7 +26,7 @@ /** * Console command for deep copying subtree from one location to another. */ -class CopySubtreeCommand extends Command implements BackwardCompatibleCommand +class CopySubtreeCommand extends Command { /** @var \Ibexa\Contracts\Core\Repository\LocationService */ private $locationService; @@ -183,9 +183,4 @@ protected function getAllChildrenCount(Location $location): int return $searchResults->totalCount; } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:copy-subtree']; - } } diff --git a/src/bundle/Core/Command/DebugConfigResolverCommand.php b/src/bundle/Core/Command/DebugConfigResolverCommand.php index f9ba80ffcc..4f4db74cd6 100644 --- a/src/bundle/Core/Command/DebugConfigResolverCommand.php +++ b/src/bundle/Core/Command/DebugConfigResolverCommand.php @@ -17,7 +17,7 @@ use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\CliDumper; -class DebugConfigResolverCommand extends Command implements BackwardCompatibleCommand +class DebugConfigResolverCommand extends Command { /** @var \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface */ private $configResolver; @@ -113,9 +113,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:debug:config-resolver', 'ezplatform:debug:config']; - } } diff --git a/src/bundle/Core/Command/DeleteContentTranslationCommand.php b/src/bundle/Core/Command/DeleteContentTranslationCommand.php index fef5088ba0..a83cfd6e7b 100644 --- a/src/bundle/Core/Command/DeleteContentTranslationCommand.php +++ b/src/bundle/Core/Command/DeleteContentTranslationCommand.php @@ -22,7 +22,7 @@ /** * Console Command which deletes a given Translation from all the Versions of a given Content Item. */ -class DeleteContentTranslationCommand extends Command implements BackwardCompatibleCommand +class DeleteContentTranslationCommand extends Command { /** @var \Ibexa\Contracts\Core\Repository\Repository */ private $repository; @@ -196,9 +196,4 @@ static function ($versionLanguageCode) use ($languageCode) { $contentMetadataUpdateStruct )->contentInfo; } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:delete-content-translation']; - } } diff --git a/src/bundle/Core/Command/RegenerateUrlAliasesCommand.php b/src/bundle/Core/Command/RegenerateUrlAliasesCommand.php index ee5f216e40..2849224d7c 100644 --- a/src/bundle/Core/Command/RegenerateUrlAliasesCommand.php +++ b/src/bundle/Core/Command/RegenerateUrlAliasesCommand.php @@ -24,10 +24,9 @@ * The ezplatform:urls:regenerate-aliases Symfony command implementation. * Recreates system URL aliases for all existing Locations and cleanups corrupted URL alias nodes. */ -class RegenerateUrlAliasesCommand extends Command implements BackwardCompatibleCommand +class RegenerateUrlAliasesCommand extends Command { public const DEFAULT_ITERATION_COUNT = 1000; - public const BEFORE_RUNNING_HINTS = <<Before you continue: - Make sure to back up your database. @@ -331,9 +330,4 @@ private function regenerateSystemUrlAliases( $output->writeln(''); $output->writeln('Done.'); } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:urls:regenerate-aliases']; - } } diff --git a/src/bundle/Core/Command/ReindexCommand.php b/src/bundle/Core/Command/ReindexCommand.php index e086e0083f..b398b3578a 100644 --- a/src/bundle/Core/Command/ReindexCommand.php +++ b/src/bundle/Core/Command/ReindexCommand.php @@ -27,7 +27,7 @@ use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; -class ReindexCommand extends Command implements BackwardCompatibleCommand +class ReindexCommand extends Command { /** @var \Ibexa\Core\Search\Common\Indexer|\Ibexa\Core\Search\Common\IncrementalIndexer */ private $searchIndexer; @@ -474,9 +474,4 @@ private function getNumberOfCPUCores() return $cores; } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:reindex']; - } } diff --git a/src/bundle/Core/Command/ResizeOriginalImagesCommand.php b/src/bundle/Core/Command/ResizeOriginalImagesCommand.php index 9970584765..b434833b20 100644 --- a/src/bundle/Core/Command/ResizeOriginalImagesCommand.php +++ b/src/bundle/Core/Command/ResizeOriginalImagesCommand.php @@ -36,7 +36,7 @@ /** * This command resizes original images stored in ezimage FieldType in given ContentType using the selected filter. */ -class ResizeOriginalImagesCommand extends Command implements BackwardCompatibleCommand +class ResizeOriginalImagesCommand extends Command { public const DEFAULT_ITERATION_COUNT = 25; public const DEFAULT_REPOSITORY_USER = 'admin'; @@ -309,9 +309,4 @@ private function store(BinaryInterface $binary, Value $image): BinaryFile return $newBinaryFile; } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:images:resize-original']; - } } diff --git a/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php b/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php index ecc69e1669..ede957f1f7 100644 --- a/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php +++ b/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php @@ -23,7 +23,7 @@ use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; -class UpdateTimestampsToUTCCommand extends Command implements BackwardCompatibleCommand +class UpdateTimestampsToUTCCommand extends Command { public const MAX_TIMESTAMP_VALUE = 2147483647; public const DEFAULT_ITERATION_COUNT = 100; @@ -503,9 +503,4 @@ private function dateStringToTimestamp($dateString) return $date->getTimestamp(); } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:timestamps:to-utc']; - } } diff --git a/src/bundle/IO/Command/MigrateFilesCommand.php b/src/bundle/IO/Command/MigrateFilesCommand.php index 02dc895727..24f61bb81e 100644 --- a/src/bundle/IO/Command/MigrateFilesCommand.php +++ b/src/bundle/IO/Command/MigrateFilesCommand.php @@ -7,7 +7,6 @@ namespace Ibexa\Bundle\IO\Command; -use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; use Ibexa\Bundle\IO\Migration\FileListerRegistry; use Ibexa\Bundle\IO\Migration\FileMigratorInterface; use Symfony\Component\Console\Command\Command; @@ -17,7 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; -final class MigrateFilesCommand extends Command implements BackwardCompatibleCommand +final class MigrateFilesCommand extends Command { /** @var mixed Configuration for metadata handlers */ private $configuredMetadataHandlers; @@ -319,9 +318,4 @@ protected function migrateFiles( ]); } } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:io:migrate-files']; - } } diff --git a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php index f55c2ec35f..2478bbd131 100644 --- a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php +++ b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php @@ -9,7 +9,6 @@ use Doctrine\DBAL\Connection; use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider; -use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -21,7 +20,7 @@ use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; -final class InstallPlatformCommand extends Command implements BackwardCompatibleCommand +final class InstallPlatformCommand extends Command { /** @var \Doctrine\DBAL\Connection */ private $connection; @@ -40,7 +39,6 @@ final class InstallPlatformCommand extends Command implements BackwardCompatible /** @var \Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider */ private $repositoryConfigurationProvider; - public const EXIT_GENERAL_DATABASE_ERROR = 4; public const EXIT_PARAMETERS_NOT_FOUND = 5; public const EXIT_UNKNOWN_INSTALL_TYPE = 6; @@ -274,9 +272,4 @@ private function executeCommand(OutputInterface $output, $cmd, $timeout = 300) throw new \RuntimeException(sprintf('An error occurred when executing the "%s" command.', escapeshellarg($cmd))); } } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:install']; - } } diff --git a/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.php b/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.php index b1aaded552..4868625a09 100644 --- a/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.php +++ b/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.php @@ -7,14 +7,13 @@ namespace Ibexa\Bundle\RepositoryInstaller\Command; -use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; use Ibexa\Contracts\Core\Repository\PasswordHashService; use Ibexa\Core\FieldType\User\UserStorage; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -final class ValidatePasswordHashesCommand extends Command implements BackwardCompatibleCommand +final class ValidatePasswordHashesCommand extends Command { /** @var \Ibexa\Core\FieldType\User\UserStorage */ private $userStorage; @@ -53,9 +52,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } - - public function getDeprecatedAliases(): array - { - return ['ezplatform:user:validate-password-hashes']; - } }