Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console] Allow commands to provide a default name for compile time registration #23887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 3 src/Symfony/Bridge/Twig/Command/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*/
class DebugCommand extends Command
{
protected static $defaultName = 'debug:twig';

private $twig;

/**
Expand Down Expand Up @@ -66,7 +68,6 @@ protected function getTwigEnvironment()
protected function configure()
{
$this
->setName('debug:twig')
->setDefinition(array(
new InputArgument('filter', InputArgument::OPTIONAL, 'Show details for all entries matching this filter'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (text or json)', 'text'),
Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Bridge/Twig/Command/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
*/
class LintCommand extends Command
{
protected static $defaultName = 'lint:twig';

private $twig;

/**
Expand Down Expand Up @@ -71,7 +73,6 @@ protected function getTwigEnvironment()
protected function configure()
{
$this
->setName('lint:twig')
->setDescription('Lints a template and outputs encountered errors')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')
->addArgument('filename', InputArgument::IS_ARRAY)
Expand Down
5 changes: 3 additions & 2 deletions 5 src/Symfony/Bridge/Twig/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
"symfony/security": "~2.8|~3.0|~4.0",
"symfony/security-acl": "~2.8|~3.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0",
"symfony/console": "~2.8|~3.0|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/var-dumper": "~2.8.10|~3.1.4|~3.2|~4.0",
"symfony/expression-language": "~2.8|~3.0|~4.0",
"symfony/web-link": "~3.3|~4.0"
},
"conflict": {
"symfony/form": "<3.2.10|~3.3,<3.3.3"
"symfony/form": "<3.2.10|~3.3,<3.3.3",
"symfony/console": "<3.4"
},
"suggest": {
"symfony/finder": "",
Expand Down
7 changes: 3 additions & 4 deletions 7 src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
*/
class AboutCommand extends ContainerAwareCommand
{
protected static $defaultName = 'about';

/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('about')
->setDescription('Displays information about the current project')
;
$this->setDescription('Displays information about the current project');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class AssetsInstallCommand extends ContainerAwareCommand
const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
const METHOD_RELATIVE_SYMLINK = 'relative symlink';

protected static $defaultName = 'assets:install';

private $filesystem;

/**
Expand All @@ -61,7 +63,6 @@ public function __construct($filesystem = null)
protected function configure()
{
$this
->setName('assets:install')
->setDefinition(array(
new InputArgument('target', InputArgument::OPTIONAL, 'The target directory', 'public'),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
*/
class CacheClearCommand extends ContainerAwareCommand
{
protected static $defaultName = 'cache:clear';

private $cacheClearer;
private $filesystem;

Expand Down Expand Up @@ -60,7 +62,6 @@ public function __construct($cacheClearer = null, Filesystem $filesystem = null)
protected function configure()
{
$this
->setName('cache:clear')
->setDefinition(array(
new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'),
new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/
final class CachePoolClearCommand extends ContainerAwareCommand
{
protected static $defaultName = 'cache:pool:clear';

private $poolClearer;

/**
Expand All @@ -51,7 +53,6 @@ public function __construct($poolClearer = null)
protected function configure()
{
$this
->setName('cache:pool:clear')
->setDefinition(array(
new InputArgument('pools', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'A list of cache pools or cache pool clearers'),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/
final class CachePoolPruneCommand extends Command
{
protected static $defaultName = 'cache:pool:prune';

private $pools;

/**
Expand All @@ -42,7 +44,6 @@ public function __construct($pools)
protected function configure()
{
$this
->setName('cache:pool:prune')
->setDescription('Prune cache pools')
->setHelp(<<<'EOF'
The <info>%command.name%</info> command deletes all expired items from all pruneable pools.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*/
class CacheWarmupCommand extends ContainerAwareCommand
{
protected static $defaultName = 'cache:warmup';

private $cacheWarmer;

/**
Expand All @@ -52,7 +54,6 @@ public function __construct($cacheWarmer = null)
protected function configure()
{
$this
->setName('cache:warmup')
->setDefinition(array(
new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
*/
class ConfigDebugCommand extends AbstractConfigCommand
{
protected static $defaultName = 'debug:config';

/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('debug:config')
->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'),
new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@
*/
class ConfigDumpReferenceCommand extends AbstractConfigCommand
{
protected static $defaultName = 'config:dump-reference';

/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('config:dump-reference')
->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle name or the extension alias'),
new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class ContainerDebugCommand extends ContainerAwareCommand
{
protected static $defaultName = 'debug:container';

/**
* @var ContainerBuilder|null
*/
Expand All @@ -43,7 +45,6 @@ class ContainerDebugCommand extends ContainerAwareCommand
protected function configure()
{
$this
->setName('debug:container')
->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
new InputOption('show-private', null, InputOption::VALUE_NONE, 'Used to show public *and* private services'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
class EventDispatcherDebugCommand extends ContainerAwareCommand
{
protected static $defaultName = 'debug:event-dispatcher';
private $dispatcher;

/**
Expand All @@ -54,7 +55,6 @@ public function __construct($dispatcher = null)
protected function configure()
{
$this
->setName('debug:event-dispatcher')
->setDefinition(array(
new InputArgument('event', InputArgument::OPTIONAL, 'An event name'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*/
class RouterDebugCommand extends ContainerAwareCommand
{
protected static $defaultName = 'debug:router';
private $router;

/**
Expand Down Expand Up @@ -79,7 +80,6 @@ public function isEnabled()
protected function configure()
{
$this
->setName('debug:router')
->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'A route name'),
new InputOption('show-controllers', null, InputOption::VALUE_NONE, 'Show assigned controllers in overview'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
class RouterMatchCommand extends ContainerAwareCommand
{
protected static $defaultName = 'router:match';

private $router;

/**
Expand Down Expand Up @@ -76,7 +78,6 @@ public function isEnabled()
protected function configure()
{
$this
->setName('router:match')
->setDefinition(array(
new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'),
new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP method'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class TranslationDebugCommand extends ContainerAwareCommand
const MESSAGE_UNUSED = 1;
const MESSAGE_EQUALS_FALLBACK = 2;

protected static $defaultName = 'debug:translation';

private $translator;
private $loader;
private $extractor;
Expand Down Expand Up @@ -72,7 +74,6 @@ public function __construct($translator = null, TranslationLoader $loader = null
protected function configure()
{
$this
->setName('debug:translation')
->setDefinition(array(
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*/
class TranslationUpdateCommand extends ContainerAwareCommand
{
protected static $defaultName = 'translation:update';

private $writer;
private $loader;
private $extractor;
Expand Down Expand Up @@ -68,7 +70,6 @@ public function __construct($writer = null, TranslationLoader $loader = null, Ex
protected function configure()
{
$this
->setName('translation:update')
->setDefinition(array(
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/
class WorkflowDumpCommand extends ContainerAwareCommand
{
protected static $defaultName = 'workflow:dump';

/**
* {@inheritdoc}
*
Expand All @@ -41,7 +43,6 @@ public function isEnabled()
protected function configure()
{
$this
->setName('workflow:dump')
->setDefinition(array(
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/
class XliffLintCommand extends BaseLintCommand
{
protected static $defaultName = 'lint:xliff';

public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null)
{
if (func_num_args()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
class YamlLintCommand extends BaseLintCommand
{
protected static $defaultName = 'lint:yaml';

public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null)
{
if (func_num_args()) {
Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/
class InitAclCommand extends ContainerAwareCommand
{
protected static $defaultName = 'init:acl';

private $connection;
private $schema;

Expand Down Expand Up @@ -70,7 +72,6 @@ public function isEnabled()
protected function configure()
{
$this
->setName('init:acl')
->setDescription('Mounts ACL tables in the database')
->setHelp(<<<'EOF'
The <info>%command.name%</info> command mounts ACL tables in the database.
Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class SetAclCommand extends ContainerAwareCommand
{
protected static $defaultName = 'acl:set';

private $provider;

/**
Expand Down Expand Up @@ -80,7 +82,6 @@ public function isEnabled()
protected function configure()
{
$this
->setName('acl:set')
->setDescription('Sets ACL for objects')
->setHelp(<<<EOF
The <info>%command.name%</info> command sets ACL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder;
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
use Symfony\Component\Security\Core\User\User;
Expand All @@ -33,6 +32,8 @@
*/
class UserPasswordEncoderCommand extends ContainerAwareCommand
{
protected static $defaultName = 'security:encode-password';

private $encoderFactory;
private $userClasses;

Expand All @@ -54,7 +55,6 @@ public function __construct(EncoderFactoryInterface $encoderFactory = null, arra
protected function configure()
{
$this
->setName('security:encode-password')
->setDescription('Encodes a password.')
->addArgument('password', InputArgument::OPTIONAL, 'The plain password to encode.')
->addArgument('user-class', InputArgument::OPTIONAL, 'The User entity class path associated with the encoder used to encode the password.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\SecurityBundle\Command\InitAclCommand;
use Symfony\Bundle\SecurityBundle\Command\SetAclCommand;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
Expand Down Expand Up @@ -170,7 +169,6 @@ private function getApplication()
$kernel->boot();

$application = new Application($kernel);
$application->add(new InitAclCommand($kernel->getContainer()->get('security.acl.dbal.connection'), $kernel->getContainer()->get('security.acl.dbal.schema')));

$initAclCommand = $application->find('init:acl');
$initAclCommandTester = new CommandTester($initAclCommand);
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.