From e46392606ff28cadfe841f77145614cff57847e8 Mon Sep 17 00:00:00 2001 From: Martin Grossmann Date: Sat, 4 Nov 2023 02:28:32 +0100 Subject: [PATCH] [shopsys] all commands are now named via attribute (#2912) --- .../CheckUnusedFriendlyUrlRouteNameListCommand.php | 8 ++------ app/src/Command/CleanStorefrontQueryCacheCommand.php | 8 ++------ app/src/Command/ImportPoFilesCommand.php | 8 ++------ app/src/Command/PerformanceDataCommand.php | 9 ++------- app/src/Command/ReplaceCdnDomainUrlCommand.php | 8 ++------ 5 files changed, 10 insertions(+), 31 deletions(-) diff --git a/app/src/Command/CheckUnusedFriendlyUrlRouteNameListCommand.php b/app/src/Command/CheckUnusedFriendlyUrlRouteNameListCommand.php index a7bd5877f8..aa3ca50531 100644 --- a/app/src/Command/CheckUnusedFriendlyUrlRouteNameListCommand.php +++ b/app/src/Command/CheckUnusedFriendlyUrlRouteNameListCommand.php @@ -6,19 +6,15 @@ use App\Component\Router\FriendlyUrl\FriendlyUrlFacade; use App\Component\Router\FriendlyUrl\FriendlyUrlRepository; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +#[AsCommand(name: 'shopsys:friendly-urls:check-entity-mapping')] class CheckUnusedFriendlyUrlRouteNameListCommand extends Command { - /** - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint - * @var string - */ - protected static $defaultName = 'shopsys:friendly-urls:check-entity-mapping'; - /** * @param \App\Component\Router\FriendlyUrl\FriendlyUrlFacade $friendlyUrlFacade */ diff --git a/app/src/Command/CleanStorefrontQueryCacheCommand.php b/app/src/Command/CleanStorefrontQueryCacheCommand.php index 165d2421a4..bf56d0ebf3 100644 --- a/app/src/Command/CleanStorefrontQueryCacheCommand.php +++ b/app/src/Command/CleanStorefrontQueryCacheCommand.php @@ -5,20 +5,16 @@ namespace App\Command; use App\Component\Redis\CleanStorefrontCacheFacade; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +#[AsCommand(name: 'shopsys:redis:clean-storefront-cache')] class CleanStorefrontQueryCacheCommand extends Command { - /** - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint - * @var string - */ - protected static $defaultName = 'shopsys:redis:clean-storefront-cache'; - /** * @param \App\Component\Redis\CleanStorefrontCacheFacade $cleanStorefrontCacheFacade */ diff --git a/app/src/Command/ImportPoFilesCommand.php b/app/src/Command/ImportPoFilesCommand.php index 1026390fd7..d007a3835d 100644 --- a/app/src/Command/ImportPoFilesCommand.php +++ b/app/src/Command/ImportPoFilesCommand.php @@ -10,12 +10,14 @@ use Shopsys\FrameworkBundle\Component\Translation\PoDumper; use Shopsys\FrameworkBundle\Component\Translation\PoFileLoader; use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; +#[AsCommand(name: 'translation:import')] class ImportPoFilesCommand extends Command { public const SOURCE_TRANSLATION_DIR = 'sourceTranslationDir'; @@ -25,12 +27,6 @@ class ImportPoFilesCommand extends Command private SymfonyLoaderAdapter $fileLoader; - /** - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint - * @var string - */ - protected static $defaultName = 'translation:import'; - /** * @param \Shopsys\FrameworkBundle\Component\Translation\PoFileLoader $fileLoader * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain diff --git a/app/src/Command/PerformanceDataCommand.php b/app/src/Command/PerformanceDataCommand.php index 9d9ad0a401..62ec22107b 100644 --- a/app/src/Command/PerformanceDataCommand.php +++ b/app/src/Command/PerformanceDataCommand.php @@ -8,19 +8,14 @@ use App\DataFixtures\Performance\CustomerUserDataFixture; use App\DataFixtures\Performance\OrderDataFixture; use App\DataFixtures\Performance\ProductDataFixture; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'shopsys:performance-data')] class PerformanceDataCommand extends Command { - /** - * @var string - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint - * @phpcsSuppress SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnlySniff.ReferenceViaFullyQualifiedName - */ - protected static $defaultName = 'shopsys:performance-data'; - /** * @param \App\DataFixtures\Performance\CategoryDataFixture $categoryDataFixture * @param \App\DataFixtures\Performance\ProductDataFixture $productDataFixture diff --git a/app/src/Command/ReplaceCdnDomainUrlCommand.php b/app/src/Command/ReplaceCdnDomainUrlCommand.php index 9c2507d1ec..e66786290a 100644 --- a/app/src/Command/ReplaceCdnDomainUrlCommand.php +++ b/app/src/Command/ReplaceCdnDomainUrlCommand.php @@ -6,18 +6,14 @@ use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Component\Domain\DomainUrlReplacer; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'shopsys:cdn-domain-url:replace')] class ReplaceCdnDomainUrlCommand extends Command { - /** - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint - * @var string - */ - protected static $defaultName = 'shopsys:cdn-domain-url:replace'; - /** * @param string $cdnDomainUrl * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain