Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:788 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15547 invoked from network); 8 Apr 2003 15:10:53 -0000 Received: from unknown (HELO localhost.localdomain) (65.198.110.5) by pb1.pair.com with SMTP; 8 Apr 2003 15:10:53 -0000 Received: (from andrei@localhost) by localhost.localdomain (8.11.6/8.11.6) id h38F8Dh04589; Tue, 8 Apr 2003 11:08:13 -0400 X-Authentication-Warning: localhost.localdomain: andrei set sender to andrei@gravitonic.com using -f Date: Tue, 8 Apr 2003 11:08:12 -0400 To: Tomica Jovanovic Cc: internals@lists.php.net Message-ID: <20030408150811.GA4563@hyperion.gravitonic.com> Mail-Followup-To: Andrei Zmievski , Tomica Jovanovic , internals@lists.php.net References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Subject: Re: [PHP-DEV] Reflection API RFC From: andrei@gravitonic.com (Andrei Zmievski) 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