Skip to content

Retrieve local variables for method? #222

Open
@dantleech

Description

Would it be reasonable to retrieve the local variables which are available in a reflection method?

e.g.

class Foobar
{
    public function barfoo(NumberOne $one, NumberTwo $two)
    {
         $numberThree = 3;
    }
}
$vars = $reflection->getMethod('barfoo')->getLocalVariables();

// [
//     'one' => Variable(type=NumberOne, declaredAt=2)
//     'two  => Variable(type=NumberTwo, declaredAt=2)
//     'numberThree' => Variable(type=int, declaredAt=4
// ];

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions