Skip to content

Placeholders in config file doesn't seem to be supported out of parameters #2020

@Taluu

Description

@Taluu

Summary of a problem or a feature request

In the config file, we should have at least these two placeholders : %rootDir% (directory where phpstan is installed) and %currentWorkingDirectory% (directory from where phpstan is launched).

But it seems they are only supported in parameters section, not the includes section... This could be nice to have at least %rootDir% supported, if you install global dependency / plugins (such as the symfony one), but don't want to clutter the config file (and commit it...) with a personnal value in my case, /home/talus/.composer/vendor/...`).

Code snippet that reproduces the problem

includes:
  - %currentWorkingDirectory%/foo
  - %rootDir%/../phpstan-symfony/extension.neon
  - %rootDir%/../phpstan-doctrine/extension.neon
  - %rootDir%/../../jangregor/phpstan-prophecy/src/extension.neon

Neither %currentworkingDirectory nor %rootDir% are resolved, as phpstan tries to load (let's say I'm triggering phpstan from /home/talus/dev/project) : File '/home/talus/dev/project/%currentWorkingDirectory%/foo' is missing or is not readable. Same thing for the ones with %rootDir%.

Expected output

The files are correctly loaded / included. :}

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