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

Sign up
Appearance settings

Commit ce3c258

Browse files
Error identifiers
1 parent 6a0cefe commit ce3c258

6 files changed

+14
-7
lines changed

‎src/Rules/Symfony/ContainerInterfacePrivateServiceRule.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function processNode(Node $node, Scope $scope): array
7171
if ($service !== null && !$service->isPublic()) {
7272
return [
7373
RuleErrorBuilder::message(sprintf('Service "%s" is private.', $serviceId))
74+
->identifier('symfonyContainer.privateService')
7475
->build(),
7576
];
7677
}

‎src/Rules/Symfony/ContainerInterfaceUnknownServiceRule.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public function processNode(Node $node, Scope $scope): array
7171
$serviceIdType = $scope->getType($node->getArgs()[0]->value);
7272
if ($service === null && !$scope->getType(Helper::createMarkerNode($node->var, $serviceIdType, $this->printer))->equals($serviceIdType)) {
7373
return [
74-
RuleErrorBuilder::message(sprintf('Service "%s" is not registered in the container.', $serviceId))->build(),
74+
RuleErrorBuilder::message(sprintf('Service "%s" is not registered in the container.', $serviceId))
75+
->identifier('symfonyContainer.serviceNotFound')
76+
->build(),
7577
];
7678
}
7779
}

‎src/Rules/Symfony/InvalidArgumentDefaultValueRule.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function processNode(Node $node, Scope $scope): array
6363
RuleErrorBuilder::message(sprintf(
6464
'Parameter #4 $default of method Symfony\Component\Console\Command\Command::addArgument() expects string|null, %s given.',
6565
$defaultType->describe(VerbosityLevel::typeOnly())
66-
))->build(),
66+
))->identifier('argument.type')->build(),
6767
];
6868
}
6969

@@ -73,7 +73,7 @@ public function processNode(Node $node, Scope $scope): array
7373
RuleErrorBuilder::message(sprintf(
7474
'Parameter #4 $default of method Symfony\Component\Console\Command\Command::addArgument() expects array<int, string>|null, %s given.',
7575
$defaultType->describe(VerbosityLevel::typeOnly())
76-
))->build(),
76+
))->identifier('argument.type')->build(),
7777
];
7878
}
7979

‎src/Rules/Symfony/InvalidOptionDefaultValueRule.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function processNode(Node $node, Scope $scope): array
6868
'Parameter #5 $default of method Symfony\Component\Console\Command\Command::addOption() expects %s, %s given.',
6969
$checkType->describe(VerbosityLevel::typeOnly()),
7070
$defaultType->describe(VerbosityLevel::typeOnly())
71-
))->build(),
71+
))->identifier('argument.type')->build(),
7272
];
7373
}
7474
}
@@ -79,7 +79,7 @@ public function processNode(Node $node, Scope $scope): array
7979
RuleErrorBuilder::message(sprintf(
8080
'Parameter #5 $default of method Symfony\Component\Console\Command\Command::addOption() expects array<string>|null, %s given.',
8181
$defaultType->describe(VerbosityLevel::typeOnly())
82-
))->build(),
82+
))->identifier('argument.type')->build(),
8383
];
8484
}
8585

‎src/Rules/Symfony/UndefinedArgumentRule.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public function processNode(Node $node, Scope $scope): array
7575
if ($scope->getType(Helper::createMarkerNode($node->var, $argType, $this->printer))->equals($argType)) {
7676
continue;
7777
}
78-
$errors[] = RuleErrorBuilder::message(sprintf('Command "%s" does not define argument "%s".', $name, $argName))->build();
78+
$errors[] = RuleErrorBuilder::message(sprintf('Command "%s" does not define argument "%s".', $name, $argName))
79+
->identifier('symfonyConsole.argumentNotFound')
80+
->build();
7981
}
8082
}
8183

‎src/Rules/Symfony/UndefinedOptionRule.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public function processNode(Node $node, Scope $scope): array
7575
if ($scope->getType(Helper::createMarkerNode($node->var, $optType, $this->printer))->equals($optType)) {
7676
continue;
7777
}
78-
$errors[] = RuleErrorBuilder::message(sprintf('Command "%s" does not define option "%s".', $name, $optName))->build();
78+
$errors[] = RuleErrorBuilder::message(sprintf('Command "%s" does not define option "%s".', $name, $optName))
79+
->identifier('symfonyConsole.optionNotFound')
80+
->build();
7981
}
8082
}
8183

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /