Skip to content

Unable to load directories using scanDirectories #3414

Closed
@OndraM

Description

@OndraM

Bug report

Hi,
PHPStan 0.10.26 is unable to load directories which were previously loaded using autoload_directories.

We are using symfony/phpunit-bridge, which installs phpunit and all of its dependencies outside of main vendor/ (in .bin/.phpunit). Thus we need to get those PHPUnit classes loaded for PHPStan.

Code snippet that reproduces the problem

PHPStan <0.10.26

# phpstan.neon
parameters:
    autoload_directories:
        - ./bin/.phpunit/phpunit-7.5-0/src

This same config no longer works with PHPStan 0.10.26:

 ------ -------------------------------------------------------------------- 
  Line   tests/.../FooBarTest.php                  
 ------ -------------------------------------------------------------------- 
         Class PHPUnit\Framework\TestCase not found.                         
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
 ------ -------------------------------------------------------------------- 

The result is the same when using scanDirectories:

# phpstan.neon
parameters:
   scanDirectories:
       - ./bin/.phpunit/phpunit-7.5-0/src

Is there something I'm doing wrong? 🤔

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