Skip to content

Commit f661fe5

Browse files
committed
TooWideMethodThrowTypeRule - metadata
1 parent 9bdeaf9 commit f661fe5

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/Rules/Exceptions/TooWideFunctionThrowTypeRule.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ public function processNode(Node $node, Scope $scope): array
4646
'Function %s() has %s in PHPDoc @throws tag but it\'s not thrown.',
4747
$functionReflection->getName(),
4848
$throwClass
49-
))->build();
49+
))
50+
->identifier('exceptions.tooWideThrowType')
51+
->metadata([
52+
'exceptionName' => $throwClass,
53+
'statementDepth' => $node->getAttribute('statementDepth'),
54+
'statementOrder' => $node->getAttribute('statementOrder'),
55+
])
56+
->build();
5057
}
5158

5259
return $errors;

src/Rules/Exceptions/TooWideMethodThrowTypeRule.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ public function processNode(Node $node, Scope $scope): array
6969
$methodReflection->getDeclaringClass()->getDisplayName(),
7070
$methodReflection->getName(),
7171
$throwClass
72-
))->build();
72+
))
73+
->identifier('exceptions.tooWideThrowType')
74+
->metadata([
75+
'exceptionName' => $throwClass,
76+
'statementDepth' => $node->getAttribute('statementDepth'),
77+
'statementOrder' => $node->getAttribute('statementOrder'),
78+
])
79+
->build();
7380
}
7481

7582
return $errors;

0 commit comments

Comments
 (0)