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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ck-php at mohiva dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Fri Dec 27 02:01:29 2024 UTC