Open leongersen opened 1 year ago
Implements #224
I've borrowed the $treatPhpDocTypesAsCertain logic from UselessCastRule.
$treatPhpDocTypesAsCertain
UselessCastRule
I'm ignoring mixed type, as that would be covered by PhpStan itself on level 9.
mixed
I kept the scope small: there are many more things that could be asserted about casts, such as:
round
floor
ceil
(float)[2.00,2.00]
1.00
I figured these cases would be better handled in other rule(s).
Implements #224
I've borrowed the
$treatPhpDocTypesAsCertain
logic fromUselessCastRule
.I'm ignoring
mixed
type, as that would be covered by PhpStan itself on level 9.I kept the scope small: there are many more things that could be asserted about casts, such as:
round
/floor
/ceil
instead;(float)[2.00,2.00]
and get1.00
, but should you want to?I figured these cases would be better handled in other rule(s).