php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51928 Create a method to register extended class
Submitted: 2010-05-27 12:04 UTC Modified: 2010-05-27 12:21 UTC
From: ck-php at mohiva dot com Assigned:
Status: Wont fix Package: Reflection related
PHP Version: 5.3.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
44 + 34 = ?
Subscribe to this entry?

 
 [2010-05-27 12:04 UTC] ck-php at mohiva dot com
Description:
------------
Reflection classes can be extended but the parent classes doesn't make the usage of other extended classes.

As an example we extend the ReflectionClass and the ReflectionMethod class.

CustomReflectionClass extends ReflectionClass {

}

CustomReflectionMethod extends ReflectionMethod {

}

When using the CustomReflectionClass::getMethods method it returns an array of ReflectionMethod objects. It should be a possibility to register the CustomReflectionMethod class so that these will be returned by the CustomReflectionClass::getMethods method.

For the DOM extensions it exists the DOMDocument::registerNodeClass method for this scenario.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-27 12:21 UTC] johannes@php.net
-Status: Open +Status: Wont fix
 [2010-05-27 12:21 UTC] johannes@php.net
It is suggested to use composition (has-a) instead of subtyping (is-a) for the reflection instances. Adding support to return custom types isn't planned.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 12:01:29 2024 UTC