On Tue, 08 Apr 2003, Tomica Jovanovic wrote:
> First of all, why isn't InterfaceType base class for ClassType, since,
> in fact, class _is_ an interface, and every method of InterfaceType is
> in fact present in the ClassType (except for the getParentInterface()
> which is named getParentClass in ClassType, but could easily be named
> getParent in both classes, or the getParentInterface() could be
> "non-virtual" in the InterfaceType class...)
True. I'll think about having ClassTypep inherit from InterfaceType.
> Second, why aren't some of the methods from ClassType available in the
> InterfaceType, when they are clearly valid there. Some of them include:
>
> class InterfaceType {
>
> // same as ClassType::getInterfaces()
> // but not sure about this one.. didn't really understand if
> // Interface can "implement", or extend more than one
> // Interface... (and BTW, if they cant, they should ;)
> function getInterfaces();
Doesn't make sense. An interface can extend only one interface.
> // same as ClassType::hasInterface($name)
> // look the note in the previous method
> function hasInterface($name);
See above.
> // same as ClassType::getModifiers()
> // the RFC states "currently only ABSTRACT" which doesn't apply
> // to Interfaces, but might be usable later when/if more
> // modifiers are added
> function getModifiers();
Interfaces don't have any modifiers.
> // same as ClassType::isInstanceOf()
> // but with a slightly different meaning. it would return if $obj is
> // an instance of a Class that implements this Interface (and
> // thus, can safely be looked at as an "instance" of this Interface)
> function isInstanceOf($obj);
I guess this would be nice.
-Andrei http://www.gravitonic.com/
If you find a job that you love, you'll
never work another day in your life.
- Mark Jackson