properties are reported unused even though they are used via union type:
<?php
class A {
public float $amount;
}
class B {
public float $amount;
}
/** @param A|B $aOrB */
function doFoo($aOrB): void {
echo $aOrB->amount;
}
function doFooBar(A|B $aOrB): void {
echo $aOrB->amount;
}
reports
------ --------------------------------------------------------------------------------------------------------
Line test.php
------ --------------------------------------------------------------------------------------------------------
3 Public property "A::$amount" is never used
💡 Either reduce visibility or annotate it or its class with @api
7 Public property "B::$amount" is never used
💡 Either reduce visibility or annotate it or its class with @api
properties are reported unused even though they are used via union type:
reports