Skip to content

Commit 5a58daa

Browse files
nicolas-grekaschalasr
authored andcommitted
[Console] Add protected static $defaultName to set the default name of a Command
1 parent 1395ddb commit 5a58daa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Command/LintCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
*/
2929
class LintCommand extends Command
3030
{
31+
protected static $defaultName = 'lint:yaml';
32+
3133
private $parser;
3234
private $format;
3335
private $displayCorrectFiles;
@@ -48,7 +50,6 @@ public function __construct($name = null, $directoryIteratorProvider = null, $is
4850
protected function configure()
4951
{
5052
$this
51-
->setName('lint:yaml')
5253
->setDescription('Lints a file and outputs encountered errors')
5354
->addArgument('filename', null, 'A file or a directory or STDIN')
5455
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"php": "^5.5.9|>=7.0.8"
2020
},
2121
"require-dev": {
22-
"symfony/console": "~2.8|~3.0|~4.0"
22+
"symfony/console": "~3.4|~4.0"
23+
},
24+
"conflict": {
25+
"symfony/console": "<3.4"
2326
},
2427
"suggest": {
2528
"symfony/console": "For validating YAML files using the lint command"

0 commit comments

Comments
 (0)