8000 Merge branch '3.4' · symfony/symfony@3a9653d · GitHub
[go: up one dir, main page]

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)
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'),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@
3030
*/
3131
class ConfigDumpReferenceCommand extends AbstractConfigCommand
3232
{
33+
protected static $defaultName = 'config:dump-reference';
34+
3335
/**
3436
* {@inheritdoc}
3537
*/
3638
protected function configure()
3739
{
3840
$this
39-
->setName('config:dump-reference')
4041
->setDefinition(array(
4142
new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle name or the extension alias'),
4243
new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
*/
3434
class ContainerDebugCommand extends Command
3535
{
36+
protected static $defaultName = 'debug:container';
37+
3638
/**
3739
* @var ContainerBuilder|null
3840
*/
@@ -44,7 +46,6 @@ class ContainerDebugCommand extends Command
4446
protected function configure()
4547
{
4648
$this
47-
->setName('debug:container')
4849
->setDefinition(array(
4950
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
5051
new InputOption('show-private', null, InputOption::VALUE_NONE, 'Used to show public *and* private services'),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030
class EventDispatcherDebugCommand extends Command
3131
{
32+
protected static $defaultName = 'debug:event-dispatcher';
3233
private $dispatcher;
3334

3435
public function __construct(EventDispatcherInterface $dispatcher)
@@ -44,7 +45,6 @@ public function __construct(EventDispatcherInterface $dispatcher)
4445
protected function configure()
4546
{
4647
$this
47-
->setName('debug:event-dispatcher')
4848
->setDefinition(array(
4949
new InputArgument('event', InputArgument::OPTIONAL, 'An event name'),
5050
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
*/
3434
class RouterDebugCommand extends Command
3535
{
36+
protected static $defaultName = 'debug:router';
3637
private $router;
3738

3839
public function __construct(RouterInterface $router)
@@ -48,7 +49,6 @@ public function __construct(RouterInterface $router)
4849
protected function configure()
4950
{
5051
$this
51-
->setName('debug:router')
5252
->setDefinition(array(
5353
new InputArgument('name', InputArgument::OPTIONAL, 'A route name'),
5454
new InputOption('show-controllers', null, InputOption::VALUE_NONE, 'Show assigned controllers in overview'),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
*/
3131
class RouterMatchCommand extends Command
3232
{
33+
protected static $defaultName = 'router:match';
34+
3335
private $router;
3436

3537
public function __construct(RouterInterface $router)
@@ -45,7 +47,6 @@ public function __co 17AE nstruct(RouterInterface $router)
4547
protected function configure()
4648
{
4749
$this
48-
->setName('router:match')
4950
->setDefinition(array(
5051
new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'),
5152
new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP method'),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class TranslationDebugCommand extends Command
4141
const MESSAGE_UNUSED = 1;
4242
const MESSAGE_EQUALS_FALLBACK = 2;
4343

44+
protected static $defaultName = 'debug:translation';
45+
4446
private $translator;
4547
private $loader;
4648
private $extractor;
@@ -60,7 +62,6 @@ public function __construct(TranslatorInterface $translator, TranslationLoader $
6062
protected function configure()
6163
{
6264
$this
63-
->setName('debug:translation')
6465
->setDefinition(array(
6566
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
6667
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
*/
3535
class TranslationUpdateCommand extends Command
3636
{
37+
protected static $defaultName = 'translation:update';
38+
3739
private $writer;
3840
private $loader;
3941
private $extractor;
@@ -61,7 +63,6 @@ public function __construct(TranslationWriterInterface $writer, TranslationLoade
6163
protected function configure()
6264
{
6365
$this
64-
->setName('translation:update')
6566
->setDefinition(array(
6667
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
6768
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
*/
2727
class WorkflowDumpCommand extends Command
2828
{
29+
protected static $defaultName = 'workflow:dump';
30+
2931
/**
3032
* {@inheritdoc}
3133
*/
3234
protected function configure()
3335
{
3436
$this
35-
->setName('workflow:dump')
3637
->setDefinition(array(
3738
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
3839
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525
class XliffLintCommand extends BaseLintCommand
2626
{
27+
protected static $defaultName = 'lint:xliff';
28+
2729
public function __construct()
2830
{
2931
$directoryIteratorProvider = function ($directory, $default) {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
class YamlLintCommand extends BaseLintCommand
2525
{
26+
protected static $defaultName = 'lint:yaml';
27+
2628
public function __construct()
2729
{
2830
$directoryIteratorProvider = function ($directory, $default) {

src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php

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

@@ -44,7 +46,6 @@ public function __construct(Connection $connection, Schema $schema)
4446
protected function configure()
4547
{
4648
$this
47-
->setName('init:acl')
4849
->setDescription('Mounts ACL tables in the database')
4950
->setHelp(<<<'EOF'
5051
The <info>%command.name%</info> command mounts ACL tables in the database.

src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php

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

3739
public function __construct(MutableAclProviderInterface $provider)
@@ -47,7 +49,6 @@ public function __construct(MutableAclProviderInterface $provider)
4749
protected function configure()
4850
{
4951
$this
50-
->setName('acl:set')
5152
->setDescription('Sets ACL for objects')
5253
->setHelp(<<<EOF
5354
The <info>%command.name%</info> command sets ACL.

src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php

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

@@ -48,7 +50,6 @@ public function __construct(EncoderFactoryInterface $encoderFactory, array $user
4850
protected function configure()
4951
{
5052
$this
51-
->setName('security:encode-password')
5253
->setDescription('Encodes a password.')
5354
->addArgument('password', InputArgument::OPTIONAL, 'The plain password to encode.')
5455
->addArgument('user-class', InputArgument::OPTIONAL, 'The User entity class path associated with the encoder used to encode the password.')

src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* file that was distributed with this source code.
2121
*/
2222
use Symfony\Bundle\FrameworkBundle\Console\Application;
23-
use Symfony\Bundle\SecurityBundle\Command\InitAclCommand;
2423
use Symfony\Bundle\SecurityBundle\Command\SetAclCommand;
2524
use Symfony\Component\Console\Tester\CommandTester;
2625
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
@@ -170,7 +169,6 @@ private function getApplication()
170169
$kernel->boot();
171170

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

175173
$initAclCommand = $application->find('init:acl');
176174
$initAclCommandTester = new CommandTester($initAclCommand);

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
},
4747
"conflict": {
4848
"symfony/var-dumper": "<3.4",
49-
"symfony/event-dispatcher": "<3.4"
49+
"symfony/event-dispatcher": "<3.4",
50+
"symfony/console": "<3.4"
5051
},
5152
"suggest": {
5253
"symfony/security-acl": "For using the ACL functionality of this bundle"

src/Symfony/Bundle/TwigBundle/Resources/views/base_js.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
2525
var noop = function() {};
2626
27-
var profilerStorageKey = 'sf2/profiler/';
27+
var profilerStorageKey = 'symfony/profiler/';
2828
2929
var request = function(url, onSuccess, onError, payload, options) {
3030
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');

0 commit comments

Comments
 (0)
0