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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

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: Wed May 01 23:01:28 2024 UTC