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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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 Apr 18 21:01:29 2024 UTC