Skip to content

Commit 0afd030

Browse files
author
dmitry.budoragin
committed
Some cleanup and adjustments
1 parent 290093d commit 0afd030

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Plugin/GraphQL/DataProducer/Taxonomy/TaxonomyLoadTree.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,15 @@ public function resolve(string $vid, int $parent, ?int $max_depth, ?string $lang
158158
$resolver = $this->entityBuffer->add('taxonomy_term', $term_ids);
159159

160160
return new Deferred(function () use ($language, $resolver, $context, $access, $accessUser, $accessOperation) {
161-
/** @var \Drupal\Core\Entity\EntityInterface[] $entities */
162-
$entities = $resolver();
163-
164161
// Add the list cache tags so that the cache entry is purged
165162
// whenever a new entity of this type is saved.
166163
$type = $this->entityTypeManager->getDefinition('taxonomy_term');
167164
/** @var \Drupal\Core\Entity\EntityTypeInterface $type */
168165
$tags = $type->getListCacheTags();
169166
$context->addCacheTags($tags);
170167

171-
if (!$entities) {
168+
/** @var \Drupal\Core\Entity\EntityInterface[] $entities */
169+
if (!$entities = $resolver()) {
172170
return [];
173171
}
174172

0 commit comments

Comments
 (0)