It seems like $data can be null. However, the property $data is declared as array. Maybe change the type of the property to array|null or add a type check?
Our type inference engine has found an assignment of a scalar value (like a
string, an integer or null) to a property which is an array.
Either this assignment is in error or the assigned type should be added
to the documentation/type hint for that property.
To type hint that a parameter can be either an array or null, you can set
a type hint of array and a default value of null. The PHP interpreter will
then accept both an array or null for that parameter.
Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.
To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.
The function can be called with either null or an array for the parameter
$needle
but will only accept an array as$haystack
.