Skip to content

excludePaths must filter out path before symlinks are resolved #10321

Open

Description

@mvorisek

Feature request

In https://github.com/roundcube/roundcubemail project there is https://github.com/roundcube/roundcubemail/blob/master/public_html/plugins symlink.

When it is not excluded, PHPStan analyses the plugins directory twice. With excludePaths, it is impossible to exclude it, as excludePaths filtering is applied after the file paths are resolved.

Or better, PHPStan should be smart enough to detect if some (resolved) paths are analysed twice and analyse only the path with minimal symlink count :)

Activity

  1. ondrejmirtes commented on Dec 17, 2023

    @ondrejmirtes
    Member

    PHPStan analyses the plugins directory twice

    Are you sure? Even after this commit? phpstan/phpstan-src@7491260

  2. ondrejmirtes commented on Jan 5, 2024

    @ondrejmirtes
    Member

    Yes, this is true because this line does not use getRealPath(): https://github.com/phpstan/phpstan-src/blob/d2cdb022afa11d53d695cd0cbe3ad3036d6cfae2/src/File/FileFinder.php#L43

    However we can't simply change it because it'd be a BC break. But filtering duplicate files is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions