sulu / skeleton

Project template for starting your new project based on the Sulu content management system
https://sulu.io
MIT License
261 stars 81 forks source link

Disable phpstan strict rules #184

Closed alexander-schranz closed 2 years ago

alexander-schranz commented 2 years ago
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes #issuenum
Related issues/PRs #issuenum
License MIT
Documentation PR sulu/sulu-docs#prnum

What's in this PR?

Disable phpstan strict rules.

Why?

When added I thought we are already using that. But saw then that we did not have it in the current projects. And there are some rules which I see more as a problem then a solution like e.g.: no ?: and only boolean check in if we make e.g.: $query = $request->query->get('test'); to something like if ($query === null || $query === '') { instead of if (!$query) { which I see currently as problematic and that more bug will created by using here then if ($query === null) and forget $query === '' then it will actually be removed. Even something like $test ?: 'default' can not be done as it also hurts that rule as you are only allowed to ?? which would not include '' string. As it is already hard for me in some cases I'm currently for removing strict rules.

alexander-schranz commented 2 years ago

Tests are still failing because of a missing rector release: https://github.com/rectorphp/rector/issues/7313