Skip to content

Commit

Permalink
Merge pull request #128 from localgovdrupal/fix/127-php-phpstan-issues
Browse files Browse the repository at this point in the history
fix: phpstan issues
  • Loading branch information
finnlewis authored Oct 2, 2023
2 parents 352862e + da968bb commit d8e8121
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Plugin/Block/SubsitesBannerBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SubsitesBannerBlock extends SubsitesAbstractBlockBase {
public function build() {
$build = [];

if ($this->getSubsite($this->node)) {
if ($this->getSubsite()) {
if ($banner = $this->getSubsiteBanner()) {
$viewBuilder = $this->entityTypeManager->getViewBuilder('paragraph');
$build = $viewBuilder->view($banner);
Expand Down
4 changes: 3 additions & 1 deletion src/Plugin/Block/SubsitesNavigationBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Template\Attribute;
use Drupal\Node\NodeInterface;
use Drupal\node\NodeInterface;

/**
* Class SubsiteNavigationBlock.
Expand Down Expand Up @@ -51,6 +51,8 @@ public function build() {
$cache = (new CacheableMetadata())->addCacheableDependency($subsite_entity);
$storage = $this->getNestedSetStorage('localgov_subsites');
$node = $this->getNestedSetNodeKeyFactory()->fromEntity($subsite_entity);
$subsite_id = NULL;
$overview_entity = NULL;
if ($ancestors = $storage->findAncestors($node)) {
$tree = $storage->findDescendants($ancestors[0]->getNodeKey());
array_unshift($tree, $ancestors[0]);
Expand Down
1 change: 0 additions & 1 deletion tests/src/Functional/SubsitePagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ protected function setUp(): void {
'create localgov_subsites_overview content',

]);
$this->nodeStorage = $this->container->get('entity_type.manager')->getStorage('node');
}

/**
Expand Down

0 comments on commit d8e8121

Please sign in to comment.