It seems like $fieldType can also be of type null; however, parameter $haystack of str_contains() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
31
if (str_contains(/** @scrutinizer ignore-type */ $fieldType, 'datetime')) {
Loading history...
32
$properties[$fieldName] = new DateProperty($fieldName);
33
} elseif ($fieldType === 'boolean') {
34
$properties[$fieldName] = new BooleanProperty($fieldName);
35
} else {
36
$properties[$fieldName] = new StringProperty($fieldName);
37
}
38
39
if (\count($properties) > 10) {
40
return $properties;
41
}
42
}
43
44
foreach ($metadata->getAssociationNames() as $associationName) {
45
$properties[$associationName] = new CountProperty($associationName);