From 8b33f99a8fd0f5edce4c24430388569c6ba98fe1 Mon Sep 17 00:00:00 2001 From: Chi Date: Sun, 25 Sep 2022 14:07:16 +0500 Subject: [PATCH] Document magic properties in extractor services --- src/UriExtractor.php | 1 + src/UrlExtractor.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/UriExtractor.php b/src/UriExtractor.php index c439783..6775d54 100644 --- a/src/UriExtractor.php +++ b/src/UriExtractor.php @@ -41,6 +41,7 @@ class UriExtractor { public function extractUri(?object $input): ?string { $entity = $input; if ($input instanceof EntityReferenceFieldItemListInterface) { + /** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $item */ if ($item = $input->first()) { $entity = $item->entity; } diff --git a/src/UrlExtractor.php b/src/UrlExtractor.php index da70990..4fd8b35 100644 --- a/src/UrlExtractor.php +++ b/src/UrlExtractor.php @@ -64,6 +64,7 @@ class UrlExtractor { $entity = $input; if ($input instanceof EntityReferenceFieldItemListInterface) { + /** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $item */ if ($item = $input->first()) { $entity = $item->entity; }