I ran them as per https://tomasvotruba.com/blog/not-all-mixed-types-are-equally-useless/
Is there a less strict version of the NoMixed rules?
rules:
- Symplify\PHPStanRules\Rules\Explicit\NoMixedPropertyFetcherRule
- Symplify\PHPStanRules\Rules\Explicit\NoMixedMethodCallerRule
They find like 600 issues in a smaller app.
Some seem to be false positive and otherwise not an issue for PHPStan as a whole.
Example:
$order = $this->Orders->newEmptyEntity();
Those appear to be fine for PHPStan, as Orders is resolved as
* @property \App\Model\Table\OrdersTable&\Cake\ORM\Association\BelongsTo $Orders
on the class itself, which then in return resolves newEmptyEntity() on that OrdersTable:
* @method \App\Model\Entity\Order newEmptyEntity()
It errors with
380 Anonymous variables in a "$order->..." property fetch can lead to false dead property. Make sure the variable type is known
But it is clickable, and resolves properly through the Order docblock:
* @property int|null $user_id
So it would be more interesting to us to find the actual "undefined" objects where we call property/method on.
As those are prio to be fixed.
So maybe some param to make it only fail for actual missing ones, and assume the docblocks to be "acceptable" as the defined type?
I ran them as per https://tomasvotruba.com/blog/not-all-mixed-types-are-equally-useless/
Is there a less strict version of the NoMixed rules?
They find like 600 issues in a smaller app.
Some seem to be false positive and otherwise not an issue for PHPStan as a whole.
Example:
Those appear to be fine for PHPStan, as Orders is resolved as
on the class itself, which then in return resolves newEmptyEntity() on that OrdersTable:
It errors with
But it is clickable, and resolves properly through the Order docblock:
So it would be more interesting to us to find the actual "undefined" objects where we call property/method on.
As those are prio to be fixed.
So maybe some param to make it only fail for actual missing ones, and assume the docblocks to be "acceptable" as the defined type?