Skip to content

Commit 025e59b

Browse files
committed
Simplify foreach call
1 parent df0d93d commit 025e59b

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

src/Rules/Functions/FactoriesFunctionArgumentTypeRule.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ public function processNode(Node $node, Scope $scope): array
8585

8686
if ($returnType->isNull()->yes()) {
8787
$addTip = static function (RuleErrorBuilder $ruleErrorBuilder) use ($nameType, $function): RuleErrorBuilder {
88-
if ($nameType->getConstantStrings() === []) {
89-
return $ruleErrorBuilder;
90-
}
91-
9288
foreach ($nameType->getConstantStrings() as $constantStringType) {
9389
$ruleErrorBuilder->addTip(sprintf(
9490
'If %s is a valid class string, you can add its possible namespace(s) in <fg=cyan>codeigniter.additional%sNamespaces</> in your <fg=yellow>%%configurationFile%%</>.',

src/Rules/Functions/ServicesFunctionArgumentTypeRule.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ public function processNode(Node $node, Scope $scope): array
8080
}
8181

8282
$addTip = static function (RuleErrorBuilder $ruleErrorBuilder) use ($nameType): RuleErrorBuilder {
83-
if ($nameType->getConstantStrings() === []) {
84-
return $ruleErrorBuilder;
85-
}
86-
8783
foreach ($nameType->getConstantStrings() as $constantStringType) {
8884
$ruleErrorBuilder->addTip(sprintf(
8985
'If %s is a valid service name, you can add its possible service class(es) in <fg=cyan>codeigniter.additionalServices</> in your <fg=yellow>%%configurationFile%%</>.',

0 commit comments

Comments
 (0)