Re: Reflection API RFC

From: Date: Tue, 08 Apr 2003 08:58:08 +0000
Subject: Re: Reflection API RFC
Groups: php.internals 
Request: Send a blank email to internals+get-783@lists.php.net to get a copy of this message
hi! > I have the first draft of PHP 5 reflection API ready. You can find it at: > > http://www.gravitonic.com/software/php/reflection.txt > > Comments and suggestions are appreciated. 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...) 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 { // ... that suggested stuff in RFC // and my stuff below // 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(); // same as ClassType::hasInterface($name) // look the note in the previous method function hasInterface($name); // 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(); // 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); // same as ClassType::invokeMethod() function invokeMethod($name, $obj, $params); } // end InterfaceType that's it for now.. - zombie - Tomica Jovanovic - tomica@mbox.co.yu * As we anarchists say: There's no government like no government.

« previous php.internals (#783) next »