Download the PHP package frankvanhest/phpstan-rules-no-magic without Composer
On this page you can find all versions of the php package frankvanhest/phpstan-rules-no-magic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frankvanhest/phpstan-rules-no-magic
More information about frankvanhest/phpstan-rules-no-magic
Files in frankvanhest/phpstan-rules-no-magic
Package phpstan-rules-no-magic
Short Description PHPStan rules inspired by roave/dont https://github.com/Roave/Dont
License MIT
Informations about the package phpstan-rules-no-magic
PHPStan - Rules - No Magic
Basically these rules prevent you from using PHP magic methods. If you are looking for a Runtime usage prevention of these methods, use https://github.com/Roave/Dont.
- Installation
- Usage
- Contribution
- License
Installation
Usage
Just include the following in your phpstan.neon
file to prevent the methods __call
, __callStatic
, __clone
, __wakeup
, __unserialize
, unserialize
, __get
, __sleep
, __serialize
, serialize
, __set
and __toString
.
Of course, you can customize which methods should be prevented by choosing the desired rules.
For __call
:
For __callStatic
:
For __clone
:
For __wakeup
, __unserialize
and unserialize
(use of Serializable
interface):
For __get
:
For __sleep
, __serialize
and serialize
(use of Serializable
interface):
For __set
:
For __toString
:
Contribution
Feel free to submit an issue of pull request. When it comes to a pull request I'm curious of how it improves this packages of which problem it may solve.
There are some requirements:
- Use PSR-12 for code styling
- Write a test for every meaningful change
License
See LICENCE
All versions of phpstan-rules-no-magic with dependencies
nikic/php-parser Version ^v4.15
phpstan/phpstan Version ^1.10