Browse Source

Document magic properties in extractor services

merge-requests/17/head
Chi 2 years ago
parent
commit
8b33f99a8f
  1. 1
      src/UriExtractor.php
  2. 1
      src/UrlExtractor.php

1
src/UriExtractor.php

@ -41,6 +41,7 @@ class UriExtractor {
public function extractUri(?object $input): ?string { public function extractUri(?object $input): ?string {
$entity = $input; $entity = $input;
if ($input instanceof EntityReferenceFieldItemListInterface) { if ($input instanceof EntityReferenceFieldItemListInterface) {
/** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $item */
if ($item = $input->first()) { if ($item = $input->first()) {
$entity = $item->entity; $entity = $item->entity;
} }

1
src/UrlExtractor.php

@ -64,6 +64,7 @@ class UrlExtractor {
$entity = $input; $entity = $input;
if ($input instanceof EntityReferenceFieldItemListInterface) { if ($input instanceof EntityReferenceFieldItemListInterface) {
/** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $item */
if ($item = $input->first()) { if ($item = $input->first()) {
$entity = $item->entity; $entity = $item->entity;
} }

Loading…
Cancel
Save