Skip to content

A way to overcome PHPStan caches? #1

@tolk-vm

Description

@tolk-vm

PHPStan has internal caches. They help it not to scan a whole project every time, but to scan only changed files and their dependents.

But PHPStan knows nothing about Modulite configs (about .modulite.yaml files), that they also refer to PHP symbols. This lack faces us with problems: once yaml files are changed, PHPStan doesn't but checks for PHP files thay may be affected. Due to caching, we may see previous errors, or don't see errors where they are expected — for unchanged files.

Dropping caches (with phpstan clear-result-cache) or launching with --debug always works.

What can be done?
An acceptable solution. Once any yaml file has changed, all cache drops off automatically.
An ideal solution. Symbols in yaml files are treated as references from PHP code (classes, methods, etc.). Once a yaml file has changed, PHPStan should invalidate symbols referenced from it (both from previous and current versions).

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