function EntityFieldMethodsViaMagicReflectionExtension::getMethod
File
-
vendor/
mglaman/ phpstan-drupal/ src/ Reflection/ EntityFieldMethodsViaMagicReflectionExtension.php, line 36
Class
- EntityFieldMethodsViaMagicReflectionExtension
- Allows some common methods on fields.
Namespace
mglaman\PHPStanDrupal\ReflectionCode
public function getMethod(ClassReflection $classReflection, string $methodName) : MethodReflection {
if ($methodName === 'referencedEntities') {
$entityReferenceFieldItemListInterfaceType = new ObjectType('Drupal\\Core\\Field\\EntityReferenceFieldItemListInterface');
$classReflection = $entityReferenceFieldItemListInterfaceType->getClassReflection();
assert($classReflection !== null);
}
return new FieldItemListMethodReflection($classReflection, $methodName);
}