@@ -42,6 +42,10 @@ public function processNode(Node $node, Scope $scope): array
4242 return [];
4343 }
4444
45+ if (count ($ node ->getArgs ()) !== 2 ) {
46+ return [];
47+ }
48+
4549 if (!$ this ->reflectionProvider ->hasFunction ($ node ->name , $ scope )) {
4650 return [];
4751 }
@@ -67,15 +71,11 @@ public function processNode(Node $node, Scope $scope): array
6771 }
6872
6973 /**
70- * @param Node\Arg[] $args
74+ * @param array{ Node\Arg, Node\Arg} $args
7175 * @return list<IdentifierRuleError>
7276 */
7377 private function processAssertType (array $ args , Scope $ scope ): array
7478 {
75- if (count ($ args ) !== 2 ) {
76- return [];
77- }
78-
7979 $ expectedTypeStrings = $ scope ->getType ($ args [0 ]->value )->getConstantStrings ();
8080 if (count ($ expectedTypeStrings ) !== 1 ) {
8181 return [
@@ -100,15 +100,11 @@ private function processAssertType(array $args, Scope $scope): array
100100 }
101101
102102 /**
103- * @param Node\Arg[] $args
103+ * @param array{ Node\Arg, Node\Arg} $args
104104 * @return list<IdentifierRuleError>
105105 */
106106 private function processAssertNativeType (array $ args , Scope $ scope ): array
107107 {
108- if (count ($ args ) !== 2 ) {
109- return [];
110- }
111-
112108 $ expectedTypeStrings = $ scope ->getNativeType ($ args [0 ]->value )->getConstantStrings ();
113109 if (count ($ expectedTypeStrings ) !== 1 ) {
114110 return [
@@ -133,15 +129,11 @@ private function processAssertNativeType(array $args, Scope $scope): array
133129 }
134130
135131 /**
136- * @param Node\Arg[] $args
132+ * @param array{ Node\Arg, Node\Arg} $args
137133 * @return list<IdentifierRuleError>
138134 */
139135 private function processAssertSuperType (array $ args , Scope $ scope ): array
140136 {
141- if (count ($ args ) !== 2 ) {
142- return [];
143- }
144-
145137 $ expectedTypeStrings = $ scope ->getType ($ args [0 ]->value )->getConstantStrings ();
146138 if (count ($ expectedTypeStrings ) !== 1 ) {
147139 return [
@@ -167,15 +159,11 @@ private function processAssertSuperType(array $args, Scope $scope): array
167159 }
168160
169161 /**
170- * @param Node\Arg[] $args
162+ * @param array{ Node\Arg, Node\Arg} $args
171163 * @return list<IdentifierRuleError>
172164 */
173165 private function processAssertVariableCertainty (array $ args , Scope $ scope ): array
174166 {
175- if (count ($ args ) !== 2 ) {
176- return [];
177- }
178-
179167 $ certainty = $ args [0 ]->value ;
180168 if (!$ certainty instanceof StaticCall) {
181169 return [
0 commit comments