https://github.com/liborm85/phpstan-excludepaths-bug
https://github.com/liborm85/phpstan-excludepaths-bug
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/liborm85/phpstan-excludepaths-bug
- Owner: liborm85
- Created: 2021-01-23T13:22:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-23T14:19:09.000Z (over 5 years ago)
- Last Synced: 2025-12-25T23:26:26.646Z (4 months ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Steps to reproduce the problem
For reproduce use example repo: https://github.com/liborm85/phpstan-excludepaths-bug with folders/files structure and neon config files and follow the steps below. Where is 1 error in `src/thirdparty/ThirdpartyClass.php` file and 1 error in `src/broken/broken.php` file.
### 0. PHPStan config file `phpstan0.neon` - Work OK
Nothing is ignored.
#### Correct result with 2 errors:
```
------ --------------------------------------------------------------------
Line broken\broken.php
------ --------------------------------------------------------------------
3 Function brokenfile not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ --------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line thirdparty\ThirdpartyClass.php
------ ----------------------------------------------------------------------
6 Access to an undefined property ThirdpartyClass::$undefinedVariable.
------ ----------------------------------------------------------------------
```
### 1. PHPStan config file `phpstan1.neon` - Work OK
Folder `src/thirdparty` is excluded from analyse.
#### Correct result with 1 error:
```
------ --------------------------------------------------------------------
Line broken\broken.php
------ --------------------------------------------------------------------
3 Function brokenfile not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ --------------------------------------------------------------------
```
### 2. PHPStan config file `phpstan2.neon` - Work WRONG
Folder `src/thirdparty` is excluded from analyse.
Folder `src/broken` is excluded from analyseAndScan.
`phpstan2.neon` file:
```
excludePaths:
analyse:
- src/thirdparty
analyseAndScan:
- src/broken
```
I expect exclude `src/thirdparty` folder from analyse (only discovering symbols will be performed) and `src/broken` from analyse and scan completely.
#### Actual result:
```
------ ----------------------------------------------------------------------
Line thirdparty\ThirdpartyClass.php
------ ----------------------------------------------------------------------
6 Access to an undefined property ThirdpartyClass::$undefinedVariable.
------ ----------------------------------------------------------------------
```
#### Expected result:
```
[OK] No errors
```