Skip to content

FindReflectionsInTree doesn't find closures #1535

@dlundgren

Description

@dlundgren

While using an AggregateSourceLocater( ComposerSourceLocator, DirectoriesSourceLocator ) I'm unable to find the following closure when calling reflectAllFunctions

<?php
// scan-me/function.php
return function() {
};

I can find find the following using reflectAllClasses():

<?php
// scan-me/class.php
return new class {
};

While debugging if I had set this up correctly, I ended up at the FindReflectionsInTree class and it was here that I noticed that it only looks for Node\Stmt\Function_, if I add Node\Expr\Closure, the closure is found. It appears to also be missing Node\Expr\ArrowFunction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions