getDeclaringClass()->name . '::' . $res->name; } // Method in class Assert::same('D::foo', get(new ReflectionMethod('D', 'foo'))); // Method in trait - uses doccomment & file-line workaround Assert::same('B::foo', get(new ReflectionMethod('C', 'foo'))); // Method in trait Assert::same('B::foo', get(new ReflectionMethod('B', 'foo'))); // Method in trait Assert::same('A::foo', get(new ReflectionMethod('A', 'foo')));