Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Parsing all files in Laravel Application with no ability to avoid blade files within the app folder #2953

@alejojperez

Description

@alejojperez

API Platform version(s) affected: 4.2.6

Description
Image

$classes = ReflectionClassRecursiveIterator::getReflectionClassesFromDirectories([$directory], '(?!.*Test\.php$)');

ApiPlatform\Laravel\ApiPlatformDeferredProvider:103
The call to ReflectionClassRecursiveIterator, inside its logic, it does a require_once of all the files provided in the path, even if the files are not PHP classes. In my case, I have some blade files, and they are being output in the response body.

How to reproduce
Create any file with the .php extension, and the content of the file with HTML or Blade

Possible Solution
Provide a way to add more ignore regex, maybe on the config file?

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