Commit 869c94a1 authored by Jeremy Mikola's avatar Jeremy Mikola

Pedantic method declaration test should ignore inherited methods

parent 4dd16594
...@@ -21,6 +21,13 @@ class PedantryTest extends \PHPUnit_Framework_TestCase ...@@ -21,6 +21,13 @@ class PedantryTest extends \PHPUnit_Framework_TestCase
$class = new ReflectionClass($className); $class = new ReflectionClass($className);
$methods = $class->getMethods(); $methods = $class->getMethods();
$methods = array_filter(
$methods,
function(ReflectionMethod $method) use ($class) {
return $method->getDeclaringClass() == $class;
}
);
$getSortValue = function(ReflectionMethod $method) { $getSortValue = function(ReflectionMethod $method) {
if ($method->getModifiers() & ReflectionMethod::IS_PRIVATE) { if ($method->getModifiers() & ReflectionMethod::IS_PRIVATE) {
return '2' . $method->getName(); return '2' . $method->getName();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment