You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -106,8 +110,14 @@ public function processNode(Node $node, Scope $scope): array
106
110
}
107
111
108
112
if ($returnTypeinstanceof NeverType && $returnType->isExplicit()) {
113
+
$errorBuilder = RuleErrorBuilder::message(sprintf('%s should always throw an exception or terminate script execution but doesn\'t do that.', $description))->line($node->getNode()->getStartLine());
114
+
115
+
if ($this->bleedingEdge && $node->hasNativeReturnTypehint()) {
116
+
$errorBuilder->nonIgnorable();
117
+
}
118
+
109
119
return [
110
-
RuleErrorBuilder::message(sprintf('%s should always throw an exception or terminate script execution but doesn\'t do that.', $description))->line($node->getNode()->getStartLine())->build(),
120
+
$errorBuilder->build(),
111
121
];
112
122
}
113
123
@@ -123,10 +133,16 @@ public function processNode(Node $node, Scope $scope): array
123
133
return [];
124
134
}
125
135
136
+
$errorBuilder = RuleErrorBuilder::message(
137
+
sprintf('%s should return %s but return statement is missing.', $description, $returnType->describe(VerbosityLevel::typeOnly()))
138
+
)->line($node->getNode()->getStartLine());
139
+
140
+
if ($this->bleedingEdge && $node->hasNativeReturnTypehint()) {
141
+
$errorBuilder->nonIgnorable();
142
+
}
143
+
126
144
return [
127
-
RuleErrorBuilder::message(
128
-
sprintf('%s should return %s but return statement is missing.', $description, $returnType->describe(VerbosityLevel::typeOnly()))
0 commit comments