--level used: maxModifying paths in phpstan.neon changes nothing, it always use my app directory and only.
Bellow my phpstan.neon
includes:
- ./vendor/nunomaduro/larastan/extension.neon
parameters:
excludes_analyse:
- /*/Definitions/*
level: max
ignoreErrors:
- '#Laravel\\Passport\\ClientRepository::createPasswordGrantClient()#'
- '#Illuminate\\Database\\Query\\Builder::dynamicWhere()#'
paths:
- %rootDir%/../../../app
- %rootDir%/../../../routes
- %rootDir%/../../../tests
- %rootDir%/../../../database
Thanks for reporting this. Are you able to debug this and propose a pull request?
Thanks for reply, unfortunately I would not have time to propose a pull request.
@loic-lopez
I had the same issue, but with the excludes_analyse option. What I ended up doing was using wildcard characters. Like so:
excludes_analyse:
- /*/*/NovaServiceProvider.php
Maybe this would work for you. Not ideal, and diffidently an issue tho. But it works for now.
AFAICS, you can't specify paths in phpstan.neon when you run Larastan using php artisan code:analyse.
When you don't specify the --paths= option, Larastan will pass the app directory to PHPStan by default. PHPStan will only use the paths parameter from phpstan.neon when Larastan doesn't provide a path (so in this case: never).
The example from the documentation only works in combination with ./vendor/bin/phpstan analyse.
@staudenmeir Can confirm this behavior!
@staudenmeir @blackfyre Thanks for the input on this folks, fell free to improve this feature adding proposing a Pull Request.
The code:analyse artisan command is no longer available. Therefore, this should be no longer an issue.
Most helpful comment
AFAICS, you can't specify
pathsinphpstan.neonwhen you run Larastan usingphp artisan code:analyse.When you don't specify the
--paths=option, Larastan will pass theappdirectory to PHPStan by default. PHPStan will only use thepathsparameter fromphpstan.neonwhen Larastan doesn't provide a path (so in this case: never).The example from the documentation only works in combination with
./vendor/bin/phpstan analyse.