marek-d-lis / phpstan-symfony-rules
My PHPStan rules for Symfony i like to include in my projects
Installs: 51
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/marek-d-lis/phpstan-symfony-rules
Requires (Dev)
- phpstan/phpstan: ^2.1
README
Description
This package provides custom PHPStan rules for Symfony projects to enforce better coding practices by preventing the use of debugging and execution-halting functions such as:
var_dump()dump()dd()die()exit()
Installation
Require the package via Composer:
composer require --dev marek-d-lis/phpstan-symfony-rules
Configuration
Include the package's rules in your phpstan.neon configuration file:
includes: - vendor/marek-d-lis/phpstan-symfony-rules/extension.neon
Rules
1. NoDumpRule
- Prevents the use of
var_dump()anddump(). - Example violation:
var_dump($data); // ❌ Not allowed dump($data); // ❌ Not allowed
2. NoDieRule
- Prevents the use of
die(),exit(), anddd(). - Example violation:
die("Fatal error"); // ❌ Not allowed exit(1); // ❌ Not allowed dd($data); // ❌ Not allowed
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Marek D. Lis - Website