function FieldItemListPropertyReflection::canHandleProperty
1 call to FieldItemListPropertyReflection::canHandleProperty()
- EntityFieldsViaMagicReflectionExtension::hasProperty in vendor/
mglaman/ phpstan-drupal/ src/ Reflection/ EntityFieldsViaMagicReflectionExtension.php
File
-
vendor/
mglaman/ phpstan-drupal/ src/ Reflection/ FieldItemListPropertyReflection.php, line 34
Class
- FieldItemListPropertyReflection
- Allows field access via magic methods
Namespace
mglaman\PHPStanDrupal\ReflectionCode
public static function canHandleProperty(ClassReflection $classReflection, string $propertyName) : bool {
// @todo use the class reflection and be more specific about handled properties.
// Currently \PHPStan\Reflection\EntityFieldReflection::getType always passes FieldItemListInterface.
$names = [
'entity',
'value',
'target_id',
];
return in_array($propertyName, $names, true);
}