Skip to content

Commit 3a9653d

Browse files
Merge branch '3.4'
* 3.4: [Console] Add protected static $defaultName to set the default name of a Command removed sf2 references [Console] Allow commands to provide a default name for compile time registration [DI] Case sensitive parameter names
2 parents 18ed089 + 67abb80 commit 3a9653d

File tree

59 files changed

+424
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+424
-105
lines changed

src/Symfony/Bridge/Twig/Command/DebugCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
*/
2727
class DebugCommand extends Command
2828
{
29+
protected static $defaultName = 'debug:twig';
30+
2931
private $twig;
3032

3133
public function __construct(Environment $twig)
@@ -38,7 +40,6 @@ public function __construct(Environment $twig)
3840
protected function configure()
3941
{
4042
$this
41-
->setName('debug:twig')
4243
->setDefinition(array(
4344
new InputArgument('filter', InputArgument::OPTIONAL, 'Show details for all entries matching this filter'),
4445
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (text or json)', 'text'),

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*/
3232
class LintCommand extends Command
3333
{
34+
protected static $defaultName = 'lint:twig';
35+
3436
private $twig;
3537

3638
public function __construct(Environment $twig)
@@ -43,7 +45,6 @@ public function __construct(Environment $twig)
4345
protected function configure()
4446
{
4547
$this
46-
->setName('lint:twig')
4748
->setDescription('Lints a template and outputs encountered errors')
4849
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')
4950
->addArgument('filename', InputArgument::IS_ARRAY)

src/Symfony/Bridge/Twig/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"symfony/web-link": "~3.4|~4.0"
4040
},
4141
"conflict": {
42-
"symfony/form": "<3.4"
42+
"symfony/form": "<3.4",
43+
"symfony/console": "<3.4"
4344
},
4445
"suggest": {
4546
"symfony/finder": "",

src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@
2929
*/
3030
class AboutCommand extends Command
3131
{
32+
protected static $defaultName = 'about';
33+
3234
/**
3335
* {@inheritdoc}
3436
*/
3537
protected function configure()
3638
{
37-
$this
38-
->setName('about')
39-
->setDescription('Displays information about the current project')
40-
;
39+
$this->setDescription('Displays information about the current project');
4140
}
4241

4342
/**

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class AssetsInstallCommand extends Command
3636
const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
3737
const METHOD_RELATIVE_SYMLINK = 'relative symlink';
3838

39+
protected static $defaultName = 'assets:install';
40+
3941
private $filesystem;
4042

4143
public function __construct(Filesystem $filesystem)
@@ -51,7 +53,6 @@ public function __construct(Filesystem $filesystem)
5153
protected function configure()
5254
{
5355
$this
54-
->setName('assets:install')
5556
->setDefinition(array(
5657
new InputArgument('target', InputArgument::OPTIONAL, 'The target directory', 'public'),
5758
))

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
*/
3333
class CacheClearCommand extends Command
3434
{
35+
protected static $defaultName = 'cache:clear';
36+
3537
private $cacheClearer;
3638
private $filesystem;
3739

@@ -53,7 +55,6 @@ public function __construct(CacheClearerInterface $cacheClearer, Filesystem $fil
5355
protected function configure()
5456
{
5557
$this
56-
->setName('cache:clear')
5758
->setDefinition(array(
5859
new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'),
5960
new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),

src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
*/
2727
final class CachePoolClearCommand extends Command
2828
{
29+
protected static $defaultName = 'cache:pool:clear';
30+
2931
private $poolClearer;
3032

3133
public function __construct(Psr6CacheClearer $poolClearer)
@@ -41,7 +43,6 @@ public function __construct(Psr6CacheClearer $poolClearer)
4143
protected function configure()
4244
{
4345
$this
44-
->setName('cache:pool:clear')
4546
->setDefinition(array(
4647
new InputArgument('pools', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'A list of cache pools or cache pool clearers'),
4748
))

src/Symfony/Bundle/FrameworkBundle/Command/CachePoolPruneCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525
final class CachePoolPruneCommand extends Command
2626
{
27+
protected static $defaultName = 'cache:pool:prune';
28+
2729
private $pools;
2830

2931
/**
@@ -42,7 +44,6 @@ public function __construct($pools)
4244
protected function configure()
4345
{
4446
$this
45-
->setName('cache:pool:prune')
4647
->setDescription('Prune cache pools')
4748
->setHelp(<<<'EOF'
4849
The <info>%command.name%</info> command deletes all expired items from all pruneable pools.

src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*/
2828
class CacheWarmupCommand extends Command
2929
{
30+
protected static $defaultName = 'cache:warmup';
31+
3032
private $cacheWarmer;
3133

3234
public function __construct(CacheWarmerAggregate $cacheWarmer)
@@ -42,7 +44,6 @@ public function __construct(CacheWarmerAggregate $cacheWarmer)
4244
protected function configure()
4345
{
4446
$this
45-
->setName('cache:warmup')
4647
->setDefinition(array(
4748
new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),
4849
))

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
*/
2929
class ConfigDebugCommand extends AbstractConfigCommand
3030
{
31+
protected static $defaultName = 'debug:config';
32+
3133
/**
3234
* {@inheritdoc}
3335
*/
3436
protected function configure()
3537
{
3638
$this
37-
->setName('debug:config')
3839
->setDefinition(array(
3940
new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'),
4041
new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),

0 commit comments

Comments
 (0)