Skip to content

Commit 813e781

Browse files
committed
Fix PHPStan error calling getFlattenedSubsiteHierarchy method #156
1 parent 86246d8 commit 813e781

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Plugin/PreviewLinkAutopopulate/Subsites.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Drupal\localgov_subsites\Plugin\PreviewLinkAutopopulate;
44

55
use Drupal\localgov_subsites\Plugin\Block\SubsitesHierarchyTrait;
6+
use Drupal\node\NodeInterface;
67
use Drupal\preview_link\PreviewLinkAutopopulatePluginBase;
78

89
/**
@@ -28,6 +29,7 @@ class Subsites extends PreviewLinkAutopopulatePluginBase {
2829
* {@inheritdoc}
2930
*/
3031
public function getPreviewEntities(): array {
32+
assert($this->entity instanceof NodeInterface);
3133
return $this->getFlattenedSubsiteHierarchy($this->entity);
3234
}
3335

0 commit comments

Comments
 (0)