Skip to content

Commit

Permalink
[shopsys] all commands are now named via attribute (#2912)
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin authored Nov 4, 2023
1 parent e0f159e commit e463926
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
8 changes: 2 additions & 6 deletions app/src/Command/CleanStorefrontQueryCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
8 changes: 2 additions & 6 deletions app/src/Command/ImportPoFilesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
Expand Down
9 changes: 2 additions & 7 deletions app/src/Command/PerformanceDataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions app/src/Command/ReplaceCdnDomainUrlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e463926

Please sign in to comment.