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

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [slevomat/coding-standard](https://togithub.com/slevomat/coding-standard) | require-dev | major | `^7.0` -> `^8.0` | ---...

This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Open These updates have all been created already. Click a checkbox below to...

# Bug report Only booleans are reported in or, but not in xor. ### Code snippet that reproduces the problem https://phpstan.org/r/eccd9f25-9c42-433d-9db4-a4d28fbfb278 ### Expected output Boolean needed error.

> strictly and strongly typed code with no loose casting for those who want additional safety in extremely defensive programming. Loose comparison does loose casting with unexpected result. To achieve...

Prevent situation when comparison return can unexpected result. For example: php > $a = 0.15 + 0.15; php > $b = 0.1 + 0.2; php > $c = 0.3; php...

# Bug report I am uncertain if this is a "normal" use-case, but I see sometimes code like this: ```$a = 'a'; $a++;``` https://3v4l.org/JEv7V ... especially in some excel related...

When using `isset()` we're checking that - The property/variable/... is defined - The value is not null When the value is always defined, it could be clearer to write `$foo...

Let's open discussion, if this code, which breaks type hint of property should be allowed: https://phpstan.org/r/f5b0a55c-b46e-45d3-9c38-e7c03f164dbf ```php