Bug report
The detection of always int does to work in all cases e.g.:
// this works
return function(?int $limit, int $offset = 0): void
{
if ($limit && (0 === ($offset % $limit))) {
$this->expectInt(($offset / $limit) + 1);
}
}
// this fails
return function(?int $limit, int $offset = 0): void
{
if ($limit && $offset && (0 === ($offset % $limit))) {
$this->expectInt(($offset / $limit) + 1);
}
}
Code snippet that reproduces the problem
https://phpstan.org/r/7353d939-662d-4761-beb1-4206ef6f43b8
Expected output
No (int) casting should be required in this case as it is already (int).
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
The detection of always int does to work in all cases e.g.:
Code snippet that reproduces the problem
https://phpstan.org/r/7353d939-662d-4761-beb1-4206ef6f43b8
Expected output
No
(int)casting should be required in this case as it is already (int).Did PHPStan help you today? Did it make you happy in any way?
No response