I'm working on a GUI which introspects its working environment to provide a visual representation of class hierarchy.
I need to get the list of interfaces that a class explicitly implements, excluding the inherited ones, much like class_uses(). Both class_implements() and ReflectionClass::getInterfaceNames() seem to return all interfaces implemented in the hierarchy.
Example:
interface A {}
interface B {}
interface C {}
interface D extends C {}
class M implements A,B {}
class N extends M implements B,D {}
// For N I need some getOwnInterfaces('N') function to return ['B','D']
// class_implements('N') returns ['A','B','C','D']
Note in the example above, interface B is declared as implemented both at the super class and on the specialized class. I actually have practical occurences of this in the code.