Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldItemListPropertyReflection.php

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\Reflection

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal