bellangelo / phpstan-require-file-exists
A PHPStan rule for checking if the files mentioned in the imports really exist.
                                    Fund package maintenance!
                                                                            
                                                                                                                                        bellangelo
                                                                                    
                                                                
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/bellangelo/phpstan-require-file-exists
Requires
- php: >=7.4
- phpstan/phpstan: ~1.5
Requires (Dev)
- ext-json: *
- phpunit/phpunit: ^9.6
- squizlabs/php_codesniffer: ^3.10
README
UPDATE: This rule has been merged into PHPStan itself. Here is the PR: phpstan/phpstan-src#3294
Weirdly enough, PHPStan does not check if a file exists when used in a
require or include statement. This is a PHPStan rule that tries to do
exactly that.
Installation
composer require --dev bellangelo/phpstan-require-file-exists
Development
For local development and testing, composer.json contains several commands that you can run.
- composer run tests- runs the PHPUnit tests.
- composer run phpstan- runs PHPStan on the- srcand- testsdirectories.
- composer run phpcs- runs PHP CodeSniffer on the- srcand- testsdirectories.
- composer run phpcs:fix- runs PHP CodeSniffer on the- srcand- testsdirectories and tries to fix the issues.