Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow code from certain packages to be used in some paths #187

Open
ruudk opened this issue Sep 18, 2024 · 0 comments
Open

Only allow code from certain packages to be used in some paths #187

ruudk opened this issue Sep 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ruudk
Copy link

ruudk commented Sep 18, 2024

It would be great if I could configure the analyzer like this:

$config->onlyAllowPackagesInPaths(
    [
        'phpstan/phpstan',
    ],
    [
        __DIR__ . '/src/PHPStan/Collector/SomeCollector.php',
    ],
);

It might be specific to my project where I have an application that also ships with a PHPStan Collector. The PHPStan Collector can use code from the PHPStan library. But the rest of the application should not use it. I could solve it by extracting the Collector to a separate package, but that's a lot of extra work for no real benefit.

But it might be that this could apply to more projects too.

@janedbal janedbal added the enhancement New feature or request label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants