You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a class which extends ArrayObject and overwrites the offsetSet method.
The method has the two arguments $key and $value as defined in ArrayObject. ArrayObject itself implements ArrayAccess where the method signature is different already.
We now have three errors (since Psalm 5.16.0):
Argument 1 of Our\Class::offsetSet has wrong name $key, expecting $offset as defined by ArrayAccess::offsetSet (see https://psalm.dev/230)
Argument 1 of Our\Class::offsetSet has wrong name $key, expecting $index as defined by ArrayObject::offsetSet (see https://psalm.dev/230)
Argument 2 of Our\Class::offsetSet has wrong name $value, expecting $newval as defined by ArrayObject::offsetSet (see https://psalm.dev/230)
Error 1 and 2 contradict each other. And error 3 makes no sense (imho) because the argument is called $value in both ArrayObject and ArrayAccess.
The errors exist since version 5.16.0. Downgrading to 5.15.0 "solves" the problem.
The text was updated successfully, but these errors were encountered:
Psalm output (using commit a75d26a):
ERROR: ParamNameMismatch - 10:31 - Argument 1 of OurClass::offsetSet has wrong name $key, expecting $offset as defined by ArrayAccess::offsetSet
ERROR: ParamNameMismatch - 10:31 - Argument 1 of OurClass::offsetSet has wrong name $key, expecting $index as defined by ArrayObject::offsetSet
ERROR: ParamNameMismatch - 10:37 - Argument 2 of OurClass::offsetSet has wrong name $value, expecting $newval as defined by ArrayObject::offsetSet
PHP:
8.2.13
Psalm:
5.16.0
/5.17.0
We have a class which extends
ArrayObject
and overwrites theoffsetSet
method.The method has the two arguments
$key
and$value
as defined inArrayObject
.ArrayObject
itself implementsArrayAccess
where the method signature is different already.We now have three errors (since Psalm 5.16.0):
Argument 1 of Our\Class::offsetSet has wrong name $key, expecting $offset as defined by ArrayAccess::offsetSet (see https://psalm.dev/230)
Argument 1 of Our\Class::offsetSet has wrong name $key, expecting $index as defined by ArrayObject::offsetSet (see https://psalm.dev/230)
Argument 2 of Our\Class::offsetSet has wrong name $value, expecting $newval as defined by ArrayObject::offsetSet (see https://psalm.dev/230)
Error 1 and 2 contradict each other. And error 3 makes no sense (imho) because the argument is called
$value
in bothArrayObject
andArrayAccess
.The errors exist since version 5.16.0. Downgrading to 5.15.0 "solves" the problem.
The text was updated successfully, but these errors were encountered: