phpstan-strict-rules icon indicating copy to clipboard operation
phpstan-strict-rules copied to clipboard

Extra strict and opinionated rules for PHPStan

Results 47 phpstan-strict-rules issues
Sort by recently updated
recently updated
newest added

repro: https://phpstan.org/r/1b7e94a5-9263-4f0c-83f8-a2964c1b5d5c This is a feature request to emit a phpstan error /w strict rules to enforce the user to set the string using `Xxx::class` syntax. `Xxx::class` is guaranteed to...

As originally reported in https://github.com/phpstan/phpstan/issues/9577, calling a constructor indirectly, e.g., via a trait method alias, is not supported by `requireParentConstructorCall`. I am opening this issue per @ondrejmirtes's request there. ###...

This is a feature request to add `uselessTrim` like there is `uselessCast`. repro: https://phpstan.org/r/daf97ab2-6a1b-4d54-a48e-d7503026c1c8 It should be possible for `numeric-string`, `empty-string` and known const strings.

I propose to add, to strict rules, a rule to reject string offset access like: ``` $str[$index]; $str[5]; ``` in favor of ``` substring($str, $index, 1) substring($str, 5, 1) ```...

I can't reproduce this issue on https://phpstan.org/try, is the rule `overwriteVariablesWithLoop` set to `true` there? If I use foreach twice I got error on second run `Foreach overwrites $var with...

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Eomm/why-don-t-you-tweet](https://redirect.github.com/Eomm/why-don-t-you-tweet) | action | major | `v1` -> `v2` | --- ### Release...

### Bug report I'm not sure if this is bug or intended behavior but since SimpleXMLElement has special treatment as an Universal object crates, this should be handled as well,...