Skip to content

Caching and multiple configurations for a project #3755

@mfn

Description

@mfn

Feature request

The documentation https://phpstan.org/user-guide/result-cache is quite clear to me:

You should always analyse the whole project - the list of paths passed to the analyse command should be the same to take advantage of the result cache. If the list of paths differs from run to run, the cache is rebuilt from the ground up each time.

I experiences this when having a project with two phpstan configuration files:

  • phpstan.neon
    and
  • phpstan-tests.neon

Running phpstan with one config invalidates the result of the other.

The solution was to be explicit about the tmpDir in each configuration file, as documented in https://phpstan.org/config-reference#caching .

Suggestion: would it make sense to consider the "config file name" as part of the cache key so multiple configs wouldn't cancel out each other?

Thanks! :)

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