Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1c99543

Browse files
committedJun 19, 2019
Merge application definition when resolving command argument and options
1 parent 3f60b9f commit 1c99543

6 files changed

+6
-0
lines changed
 

‎src/Rules/Symfony/UndefinedArgumentRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function processNode(Node $node, Scope $scope): array
7575
$errors = [];
7676
foreach ($this->consoleApplicationResolver->findCommands($classReflection) as $name => $command) {
7777
try {
78+
$command->mergeApplicationDefinition();
7879
$command->getDefinition()->getArgument($argName);
7980
} catch (InvalidArgumentException $e) {
8081
if ($scope->getType(Helper::createMarkerNode($node->var, $argType, $this->printer))->equals($argType)) {

‎src/Rules/Symfony/UndefinedOptionRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function processNode(Node $node, Scope $scope): array
7575
$errors = [];
7676
foreach ($this->consoleApplicationResolver->findCommands($classReflection) as $name => $command) {
7777
try {
78+
$command->mergeApplicationDefinition();
7879
$command->getDefinition()->getOption($optName);
7980
} catch (InvalidArgumentException $e) {
8081
if ($scope->getType(Helper::createMarkerNode($node->var, $optType, $this->printer))->equals($optType)) {

‎src/Type/Symfony/InputInterfaceGetArgumentDynamicReturnTypeExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
6060
$argTypes = [];
6161
foreach ($this->consoleApplicationResolver->findCommands($classReflection) as $command) {
6262
try {
63+
$command->mergeApplicationDefinition();
6364
$argument = $command->getDefinition()->getArgument($argName);
6465
if ($argument->isArray()) {
6566
$argType = new ArrayType(new IntegerType(), new StringType());

‎src/Type/Symfony/InputInterfaceGetOptionDynamicReturnTypeExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
6262
$optTypes = [];
6363
foreach ($this->consoleApplicationResolver->findCommands($classReflection) as $command) {
6464
try {
65+
$command->mergeApplicationDefinition();
6566
$option = $command->getDefinition()->getOption($optName);
6667
if (!$option->acceptValue()) {
6768
$optType = new BooleanType();

‎src/Type/Symfony/InputInterfaceHasArgumentDynamicReturnTypeExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
5858
$returnTypes = [];
5959
foreach ($this->consoleApplicationResolver->findCommands($classReflection) as $command) {
6060
try {
61+
$command->mergeApplicationDefinition();
6162
$command->getDefinition()->getArgument($argName);
6263
$returnTypes[] = true;
6364
} catch (InvalidArgumentException $e) {

‎src/Type/Symfony/InputInterfaceHasOptionDynamicReturnTypeExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
5858
$returnTypes = [];
5959
foreach ($this->consoleApplicationResolver->findCommands($classReflection) as $command) {
6060
try {
61+
$command->mergeApplicationDefinition();
6162
$command->getDefinition()->getOption($optName);
6263
$returnTypes[] = true;
6364
} catch (InvalidArgumentException $e) {

0 commit comments

Comments
 (0)
Please sign in to comment.