ID:               36687
 Updated by:       [EMAIL PROTECTED]
 Reported By:      elias at adaptiveinstance dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Feature/Change Request
 Operating System: *
 PHP Version:      5CVS-2006-03-10 (snap)
-Assigned To:      johannes
+Assigned To:      helly
 New Comment:

After discussing this issue again we found that indeed
getClass() should return the typehine class if any and
getDeclaringClass() should return where the parameter is defined which
is the class of the method if it is a method and NULL otherwise.

Fixed in head now, fix for 5.1.3 will come, too.


Previous Comments:
------------------------------------------------------------------------

[2006-03-12 00:00:42] [EMAIL PROTECTED]

In that case you found an error besides your request.

------------------------------------------------------------------------

[2006-03-11 20:07:38] elias at adaptiveinstance dot com

In that case i must understand anythink completely wrong or...

---code
class Foo
{
        function myMeth($param0){}
}

$class = new ReflectionClass('Foo');
$params = $class->getMethod('myMeth')->getParameters();
var_dump($params[0]->getDeclaringClass());

---output
NULL
---end

...NULL is the declaring class.

------------------------------------------------------------------------

[2006-03-11 18:34:09] [EMAIL PROTECTED]

It definitively returns which class declared the parameter.
You are in RelfectionParameter here not in RelfectionTypeHint which
doesn't exist.

------------------------------------------------------------------------

[2006-03-11 18:30:00] elias at adaptiveinstance dot com

Alias or not, getDeclaringClass does not return the 'declaring' class
and i don't think someone expects this.

getTypeHintClass sounds good.

------------------------------------------------------------------------

[2006-03-11 17:08:21] [EMAIL PROTECTED]

getClass() is an alias for getDeclaringClass() in 5.1 and will be
dropped in later versions.

What you want is a new method maybe named getParameterClass() or
getTypeHintClass().

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/36687

-- 
Edit this bug report at http://bugs.php.net/?id=36687&edit=1

Reply via email to