14 Commits

Author SHA1 Message Date
Dylan K. Taylor
16d8522245
Farewell EnumTrait, you served us well 2023-09-08 11:26:11 +01:00
Dylan K. Taylor
c1638ffaab
Ban foreach by-reference at the PHPStan level 2023-08-08 17:08:13 +01:00
Dylan K. Taylor
537721fe7d
Replace Closure::fromCallable() usages with first-class callables
PHP 8.1 <3
2023-07-19 13:34:42 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
345ac75aac
Remove PHPStan rules (no longer needed)
this is enforced by php-cs-fixer now instead.
2022-01-20 19:25:34 +00:00
Dylan K. Taylor
6846f1e78a
Replace disallowed operators in tests/ 2022-01-20 16:48:36 +00:00
Dylan K. Taylor
b60dd1e9b4
Ban 'and' and 'or' operators via PHPStan 2022-01-20 16:44:59 +00:00
Dylan K. Taylor
f1723acfd3
UnsafeForeachArrayOfStringRule: use statically analysable function reference
this will ensure that it get automatically updated during refactors.
2022-01-18 00:23:29 +00:00
Dylan K. Taylor
8da27ea0aa
UnsafeForeachArrayOfStringRule: fixed outdated function name 2022-01-18 00:15:44 +00:00
Dylan K. Taylor
6d249026cc
Merge branch 'legacy/pm3' into stable 2022-01-07 20:15:15 +00:00
Dylan K. Taylor
269231c228
Ban foreach(arrayWithStringKeys as k => v)
this is not as good as phpstan/phpstan-src#769 (e.g. array_key_first()/array_key_last() aren't covered by this, nor is array_rand()) but it does eliminate the most infuriating cases where this usually crops up.
2021-11-15 22:52:05 +00:00
Dylan K. Taylor
b534ae050e DisallowEnumComparisonRule: detect bugs involving union types (Enum|null compared to Enum|null) 2020-11-14 16:51:13 +00:00
Dylan K. Taylor
0e1cea043a added some phpstan-specific generic type annotations 2020-01-13 15:05:02 +00:00
Dylan K. Taylor
a733f094ac phpstan: added a custom rule to disallow strict equality operators on enum members
comparing enums with equality operators is unreliable because there is no guarantee that the enum objects won't be somehow duplicated, through serialization, cloning or ext-parallel dumb object copying. This means that two equal enum objects may not be thw same object.
2020-01-08 19:45:05 +00:00