Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Dec 18, 2023
1 parent cacefbf commit 73b8517
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Routing/ArticleRouteDefaultProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Sulu\Bundle\RouteBundle\Routing\Defaults\RouteDefaultsProviderInterface;
use Sulu\Component\Content\Compat\Structure\StructureBridge;
use Sulu\Component\Content\Compat\StructureManagerInterface;
use Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior;
use Sulu\Component\Content\Document\WorkflowStage;
use Sulu\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface;
use Sulu\Component\Content\Metadata\StructureMetadata;
Expand Down Expand Up @@ -131,7 +132,7 @@ public function isPublished($entityClass, $id, $locale)
return false;
}

if ($object->isShadowLocaleEnabled()) {
if ($object instanceof ShadowLocaleBehavior && $object->isShadowLocaleEnabled()) {
$object = $this->documentManager->find(
$id,
$object->getShadowLocale(),
Expand Down
7 changes: 6 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ parameters:
count: 1
path: Admin/ArticleAdmin.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Admin\\\\ArticleAdmin\\:\\:getSecurityContexts\\(\\) should return array\\<string, array\\<string, array\\<string, array\\<string\\>\\>\\>\\> but returns array\\<string, array\\<string, array\\<int\\|string, array\\<int, string\\>\\>\\>\\>\\.$#"
count: 1
path: Admin/ArticleAdmin.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Admin\\\\ArticleAdmin\\:\\:getTypes\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -2147,7 +2152,7 @@ parameters:

-
message: "#^Cannot access offset 'pageNumber' on mixed\\.$#"
count: 2
count: 1
path: Preview/ArticleObjectProvider.php

-
Expand Down

0 comments on commit 73b8517

Please sign in to comment.