Skip to content

Original "whitelist" functionality instead of "expose-namespaces" #677

@ondrejmirtes

Description

@ondrejmirtes

Hello,
I just upgrade to Box 4.0.0 and it looks like it comes with a newer version of PHP-Scoper that doesn't have some original configuration options.

I figured out that files-whitelist has been replaced by exclude-files which probably works the same way, but whitelist (that accepts namespace patterns) has been replaced with expose-namespaces that works differently.

Originally, whitelist simply didn't prefix listed namespaces which was ideal for me. But expose-namespaces prefixes all namespaces and generates class_alias calls in vendor/autoload.php.

Would it be possible to somehow restore the original whitelist behaviour?

I noticed only because PHP-Scoper generates invalid code (https://gist.github.com/ondrejmirtes/81e4a2c63f011edea470d8b411efa176) but that's not the subject of my question. I'd like to match the original behaviour as much as possible because that's how prefixed and compiled PHPStan looked like for several years now, and I'd like to preserve that, because it's well-tested, and I'm afraid of unintended consequences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions