Skip to content

Commit 869c94a

Browse files
committed
Pedantic method declaration test should ignore inherited methods
1 parent 4dd1659 commit 869c94a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/PedantryTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ public function testMethodsAreOrderedAlphabeticallyByVisibility($className)
2121
$class = new ReflectionClass($className);
2222
$methods = $class->getMethods();
2323

24+
$methods = array_filter(
25+
$methods,
26+
function(ReflectionMethod $method) use ($class) {
27+
return $method->getDeclaringClass() == $class;
28+
}
29+
);
30+
2431
$getSortValue = function(ReflectionMethod $method) {
2532
if ($method->getModifiers() & ReflectionMethod::IS_PRIVATE) {
2633
return '2' . $method->getName();

0 commit comments

Comments
 (0)