From 0f2b1da486957bf3f2731a46ea32e0d067d4146e Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Wed, 13 Sep 2023 14:26:00 +0200 Subject: [PATCH 1/5] Fix indexing of unpublished shadow documents --- Document/Index/ArticleIndexer.php | 10 ++-------- Document/Index/IndexerInterface.php | 3 +-- Document/Subscriber/ArticleSubscriber.php | 2 +- Resources/translations/admin.de.json | 3 ++- Resources/translations/admin.en.json | 3 ++- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Document/Index/ArticleIndexer.php b/Document/Index/ArticleIndexer.php index f4b9a814..e9940973 100644 --- a/Document/Index/ArticleIndexer.php +++ b/Document/Index/ArticleIndexer.php @@ -429,15 +429,9 @@ public function remove(ArticleDocument $document/*, ?string $locale = null*/): v } } - /** - * @deprecated - * @see ArticleIndexer::replaceWithGhostData - */ public function removeLocale(ArticleDocument $document, string $locale): void { - @\trigger_error('Calling ArticleIndexer::removeLocale() is deprecated and will be removed in future. Use ArticleIndexer::replaceWithGhostData() instead.', \E_USER_DEPRECATED); - - $this->replaceWithGhostData($document, $locale); + $this->remove($document, $locale); } public function replaceWithGhostData(ArticleDocument $document, string $locale): void @@ -530,7 +524,7 @@ protected function createOrUpdateShadows(ArticleDocument $document): void return; } - foreach (\array_keys($this->inspector->getShadowLocales($document)) as $shadowLocale) { + foreach (\array_keys($this->inspector->getShadowLocales($document, true)) as $shadowLocale) { try { /** @var ArticleDocument $shadowDocument */ $shadowDocument = $this->documentManager->find($document->getUuid(), $shadowLocale); diff --git a/Document/Index/IndexerInterface.php b/Document/Index/IndexerInterface.php index 087e4ead..1410f0b8 100644 --- a/Document/Index/IndexerInterface.php +++ b/Document/Index/IndexerInterface.php @@ -43,8 +43,7 @@ public function index(ArticleDocument $document): void; public function remove(ArticleDocument $document/*, ?string $locale = null*/): void; /** - * @deprecated - * @see IndexerInterface::replaceWithGhostData + * Removes a locale for the given document from the index. */ public function removeLocale(ArticleDocument $document, string $locale): void; diff --git a/Document/Subscriber/ArticleSubscriber.php b/Document/Subscriber/ArticleSubscriber.php index 7e68fa46..fcc535f7 100644 --- a/Document/Subscriber/ArticleSubscriber.php +++ b/Document/Subscriber/ArticleSubscriber.php @@ -495,7 +495,7 @@ public function handleRemoveLocaleLive(RemoveLocaleEvent $event) return; } - $this->liveIndexer->replaceWithGhostData($document, $event->getLocale()); + $this->liveIndexer->removeLocale($document, $event->getLocale()); $this->liveIndexer->flush(); } diff --git a/Resources/translations/admin.de.json b/Resources/translations/admin.de.json index 1411b874..fc756ab3 100644 --- a/Resources/translations/admin.de.json +++ b/Resources/translations/admin.de.json @@ -28,5 +28,6 @@ "sulu_activity.description.articles.translation_copied": "{userFullName} hat die Sprachvariante für \"{context_sourceLocale}\" des Artikels \"{resourceTitle}\" nach \"{resourceLocale}\" kopiert", "sulu_activity.description.articles.translation_removed": "{userFullName} hat die Sprachvariante für \"{resourceLocale}\" des Artikels \"{resourceTitle}\" gelöscht", "sulu_activity.description.articles.translation_restored": "{userFullName} hat die Sprachvariante für \"{resourceLocale}\" des Artikels \"{resourceTitle}\" wiederhergestellt", - "sulu_activity.description.articles.version_restored": "{userFullName} hat die Version \"{context_version}\" des Artikels \"{resourceTitle}\" wiederhergestellt" + "sulu_activity.description.articles.version_restored": "{userFullName} hat die Version \"{context_version}\" des Artikels \"{resourceTitle}\" wiederhergestellt", + "sulu_activity.description.articles.route_removed": "{userFullName} hat die Route \"{resourceTitle}\" gelöscht." } diff --git a/Resources/translations/admin.en.json b/Resources/translations/admin.en.json index 7fb46e75..5fb8e0d0 100644 --- a/Resources/translations/admin.en.json +++ b/Resources/translations/admin.en.json @@ -28,5 +28,6 @@ "sulu_activity.description.articles.translation_copied": "{userFullName} has copied the \"{context_sourceLocale}\" translation of the article \"{resourceTitle}\" into \"{resourceLocale}\"", "sulu_activity.description.articles.translation_removed": "{userFullName} has removed the \"{resourceLocale}\" translation of the article \"{resourceTitle}\"", "sulu_activity.description.articles.translation_restored": "{userFullName} has restored the \"{resourceLocale}\" translation of the article \"{resourceTitle}\"", - "sulu_activity.description.articles.version_restored": "{userFullName} has restored the version \"{context_version}\" of the article \"{resourceTitle}\"" + "sulu_activity.description.articles.version_restored": "{userFullName} has restored the version \"{context_version}\" of the article \"{resourceTitle}\"", + "sulu_activity.description.articles.route_removed": "{userFullName} has removed the route \"{resourceTitle}\"." } From cecf10ebbe7168bc91d0782171f9e8429bfec3bc Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Wed, 13 Sep 2023 14:51:00 +0200 Subject: [PATCH 2/5] Revert deprecation --- Document/Index/ArticleIndexer.php | 10 ++++++++-- Document/Subscriber/ArticleSubscriber.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Document/Index/ArticleIndexer.php b/Document/Index/ArticleIndexer.php index e9940973..ce075272 100644 --- a/Document/Index/ArticleIndexer.php +++ b/Document/Index/ArticleIndexer.php @@ -429,9 +429,15 @@ public function remove(ArticleDocument $document/*, ?string $locale = null*/): v } } + /** + * @deprecated + * @see ArticleIndexer::replaceWithGhostData + */ public function removeLocale(ArticleDocument $document, string $locale): void { - $this->remove($document, $locale); + @\trigger_error('Calling ArticleIndexer::removeLocale() is deprecated and will be removed in future. Use ArticleIndexer::replaceWithGhostData() instead.', \E_USER_DEPRECATED); + + $this->replaceWithGhostData($document, $locale); } public function replaceWithGhostData(ArticleDocument $document, string $locale): void @@ -524,7 +530,7 @@ protected function createOrUpdateShadows(ArticleDocument $document): void return; } - foreach (\array_keys($this->inspector->getShadowLocales($document, true)) as $shadowLocale) { + foreach (\array_keys($this->inspector->getPublishedShadowLocales($document)) as $shadowLocale) { try { /** @var ArticleDocument $shadowDocument */ $shadowDocument = $this->documentManager->find($document->getUuid(), $shadowLocale); diff --git a/Document/Subscriber/ArticleSubscriber.php b/Document/Subscriber/ArticleSubscriber.php index fcc535f7..1aec28ab 100644 --- a/Document/Subscriber/ArticleSubscriber.php +++ b/Document/Subscriber/ArticleSubscriber.php @@ -495,7 +495,7 @@ public function handleRemoveLocaleLive(RemoveLocaleEvent $event) return; } - $this->liveIndexer->removeLocale($document, $event->getLocale()); + $this->liveIndexer->remove($document, $event->getLocale()); $this->liveIndexer->flush(); } From b3053ad9d169c01c97e55b4f085e4154d4392d6a Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Wed, 13 Sep 2023 16:37:10 +0200 Subject: [PATCH 3/5] Fix shadow publishing --- Document/Index/ArticleGhostIndexer.php | 2 +- Document/Index/ArticleIndexer.php | 30 +++++++++++++++++++------- Document/Index/IndexerInterface.php | 3 ++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Document/Index/ArticleGhostIndexer.php b/Document/Index/ArticleGhostIndexer.php index 0731d8d2..8c529593 100644 --- a/Document/Index/ArticleGhostIndexer.php +++ b/Document/Index/ArticleGhostIndexer.php @@ -87,7 +87,7 @@ public function index(ArticleDocument $document): void } $article = $this->createOrUpdateArticle($document, $document->getLocale()); - $this->createOrUpdateShadows($document); + $this->updateShadows($document); $this->createOrUpdateGhosts($document); $this->dispatchIndexEvent($document, $article); $this->manager->persist($article); diff --git a/Document/Index/ArticleIndexer.php b/Document/Index/ArticleIndexer.php index ce075272..35496641 100644 --- a/Document/Index/ArticleIndexer.php +++ b/Document/Index/ArticleIndexer.php @@ -18,6 +18,7 @@ use Sulu\Bundle\ArticleBundle\Document\ArticleDocument; use Sulu\Bundle\ArticleBundle\Document\ArticlePageDocument; use Sulu\Bundle\ArticleBundle\Document\ArticlePageViewObject; +use Sulu\Bundle\ArticleBundle\Document\ArticleViewDocument; use Sulu\Bundle\ArticleBundle\Document\ArticleViewDocumentInterface; use Sulu\Bundle\ArticleBundle\Document\Index\Factory\ExcerptFactory; use Sulu\Bundle\ArticleBundle\Document\Index\Factory\SeoFactory; @@ -327,6 +328,15 @@ private function getBlockContentFieldsRecursive(array $blocks, ArticleDocument $ return $contentFields; } + protected function findViewDocument(ArticleDocument $document, string $locale): ?ArticleViewDocumentInterface + { + $articleId = $this->getViewDocumentId($document->getUuid(), $locale); + /** @var ArticleViewDocumentInterface $article */ + $article = $this->manager->find($this->documentFactory->getClass('article'), $articleId); + + return $article; + } + /** * Returns view-document from index or create a new one. */ @@ -335,9 +345,7 @@ protected function findOrCreateViewDocument( string $locale, string $localizationState ): ?ArticleViewDocumentInterface { - $articleId = $this->getViewDocumentId($document->getUuid(), $locale); - /** @var ArticleViewDocumentInterface $article */ - $article = $this->manager->find($this->documentFactory->getClass('article'), $articleId); + $article = $this->findViewDocument($document, $locale); if ($article) { // Only index ghosts when the article isn't a ghost himself. @@ -351,7 +359,7 @@ protected function findOrCreateViewDocument( } $article = $this->documentFactory->create('article'); - $article->setId($articleId); + $article->setId($this->getViewDocumentId($document->getUuid(), $locale)); $article->setUuid($document->getUuid()); $article->setLocale($locale); @@ -505,11 +513,12 @@ public function index(ArticleDocument $document): void $this->dispatchIndexEvent($document, $article); $this->manager->persist($article); - $this->createOrUpdateShadows($document); + $this->updateShadows($document); } protected function indexShadow(ArticleDocument $document): void { + /** @var ArticleDocument $shadowDocument */ $shadowDocument = $this->documentManager->find( $document->getUuid(), $document->getOriginalLocale(), @@ -519,21 +528,26 @@ protected function indexShadow(ArticleDocument $document): void ); $article = $this->createOrUpdateArticle($shadowDocument, $document->getOriginalLocale(), LocalizationState::SHADOW); - $this->dispatchIndexEvent($shadowDocument, $article); $this->manager->persist($article); } - protected function createOrUpdateShadows(ArticleDocument $document): void + protected function updateShadows(ArticleDocument $document): void { if ($document->isShadowLocaleEnabled()) { return; } - foreach (\array_keys($this->inspector->getPublishedShadowLocales($document)) as $shadowLocale) { + foreach (\array_keys($this->inspector->getShadowLocales($document)) as $shadowLocale) { try { /** @var ArticleDocument $shadowDocument */ $shadowDocument = $this->documentManager->find($document->getUuid(), $shadowLocale); + + // update shadow only if original document exists + if (!$this->findViewDocument($shadowDocument, $document->getLocale())) { + continue; + } + $this->indexShadow($shadowDocument); } catch (DocumentManagerException $documentManagerException) { // @ignoreException diff --git a/Document/Index/IndexerInterface.php b/Document/Index/IndexerInterface.php index 1410f0b8..087e4ead 100644 --- a/Document/Index/IndexerInterface.php +++ b/Document/Index/IndexerInterface.php @@ -43,7 +43,8 @@ public function index(ArticleDocument $document): void; public function remove(ArticleDocument $document/*, ?string $locale = null*/): void; /** - * Removes a locale for the given document from the index. + * @deprecated + * @see IndexerInterface::replaceWithGhostData */ public function removeLocale(ArticleDocument $document, string $locale): void; From 628248b62cd27ad41271dfce5e7c3fb6348de94b Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Thu, 14 Sep 2023 00:16:40 +0200 Subject: [PATCH 4/5] Add tests --- Document/Index/ArticleIndexer.php | 1 - .../Application/config/webspaces/sulu.io.xml | 1 + .../Document/Index/ArticleIndexerTest.php | 97 +++++++++++++++++++ .../Subscriber/ArticleSubscriberTest.php | 60 ++++++++++++ 4 files changed, 158 insertions(+), 1 deletion(-) diff --git a/Document/Index/ArticleIndexer.php b/Document/Index/ArticleIndexer.php index 35496641..2fd4eecf 100644 --- a/Document/Index/ArticleIndexer.php +++ b/Document/Index/ArticleIndexer.php @@ -18,7 +18,6 @@ use Sulu\Bundle\ArticleBundle\Document\ArticleDocument; use Sulu\Bundle\ArticleBundle\Document\ArticlePageDocument; use Sulu\Bundle\ArticleBundle\Document\ArticlePageViewObject; -use Sulu\Bundle\ArticleBundle\Document\ArticleViewDocument; use Sulu\Bundle\ArticleBundle\Document\ArticleViewDocumentInterface; use Sulu\Bundle\ArticleBundle\Document\Index\Factory\ExcerptFactory; use Sulu\Bundle\ArticleBundle\Document\Index\Factory\SeoFactory; diff --git a/Tests/Application/config/webspaces/sulu.io.xml b/Tests/Application/config/webspaces/sulu.io.xml index cf19acdf..21b61c43 100644 --- a/Tests/Application/config/webspaces/sulu.io.xml +++ b/Tests/Application/config/webspaces/sulu.io.xml @@ -9,6 +9,7 @@ + default diff --git a/Tests/Functional/Document/Index/ArticleIndexerTest.php b/Tests/Functional/Document/Index/ArticleIndexerTest.php index e66e875c..1f1a65a4 100644 --- a/Tests/Functional/Document/Index/ArticleIndexerTest.php +++ b/Tests/Functional/Document/Index/ArticleIndexerTest.php @@ -264,6 +264,91 @@ public function testIndexShadow() $this->assertEquals($contentData['article'], 'Test content - CHANGED!'); } + public function testUnpublishedShadows(): void + { + $article = $this->createArticle( + [ + 'article' => 'Test content', + ], + 'Test Article', + 'default_with_route' + ); + $secondLocale = 'de'; + $thirdLocale = 'fr'; + + $this->updateArticle( + $article['id'], + $secondLocale, + [ + 'id' => $article['id'], + 'article' => 'Test Inhalt', + ], + 'Test Artikel Deutsch', + 'default_with_route' + ); + $this->updateArticle( + $article['id'], + $secondLocale, + [ + 'id' => $article['id'], + 'shadowOn' => true, + 'shadowBaseLanguage' => $this->locale, + ], + null, + null + ); + + $this->updateArticle( + $article['id'], + $thirdLocale, + [ + 'id' => $article['id'], + 'article' => 'Test French Content', + ], + 'Test Artikel French', + 'default_with_route' + ); + $this->updateArticle( + $article['id'], + $thirdLocale, + [ + 'id' => $article['id'], + 'shadowOn' => true, + 'shadowBaseLanguage' => $this->locale, + ], + null, + null + ); + + self::assertNotNull($this->findViewDocument($article['id'], $this->locale)); + self::assertNotNull($this->findViewDocument($article['id'], $secondLocale)); + self::assertNotNull($this->findViewDocument($article['id'], $thirdLocale)); + + $this->unpublishArticle($article['id'], $this->locale); + $this->unpublishArticle($article['id'], $secondLocale); + $this->unpublishArticle($article['id'], $thirdLocale); + + self::assertNull($this->findViewDocument($article['id'], $this->locale)); + self::assertNull($this->findViewDocument($article['id'], $secondLocale)); + self::assertNull($this->findViewDocument($article['id'], $thirdLocale)); + + // publish the shadow + $this->updateArticle( + $article['id'], + $secondLocale, + [ + 'id' => $article['id'], + ], + null, + null + ); + + // only the DE shadow should be published + self::assertNull($this->findViewDocument($article['id'], $this->locale)); + self::assertNotNull($this->findViewDocument($article['id'], $secondLocale)); + self::assertNull($this->findViewDocument($article['id'], $thirdLocale)); + } + public function testIndexPageTreeRoute() { $page = $this->createPage(); @@ -542,6 +627,18 @@ private function updateArticle( return \json_decode($this->client->getResponse()->getContent(), true); } + private function unpublishArticle($uuid, $locale = null) + { + $this->client->jsonRequest( + 'POST', + '/api/articles/' . $uuid . '?locale=' . ($locale ?: $this->locale) . '&action=unpublish' + ); + + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); + + return \json_decode($this->client->getResponse()->getContent(), true); + } + /** * Create article page. * diff --git a/Tests/Unit/Document/Subscriber/ArticleSubscriberTest.php b/Tests/Unit/Document/Subscriber/ArticleSubscriberTest.php index 4d2a4602..f6509564 100644 --- a/Tests/Unit/Document/Subscriber/ArticleSubscriberTest.php +++ b/Tests/Unit/Document/Subscriber/ArticleSubscriberTest.php @@ -31,6 +31,7 @@ use Sulu\Component\DocumentManager\Event\PublishEvent; use Sulu\Component\DocumentManager\Event\RemoveDraftEvent; use Sulu\Component\DocumentManager\Event\RemoveEvent; +use Sulu\Component\DocumentManager\Event\RemoveLocaleEvent; use Sulu\Component\DocumentManager\Event\ReorderEvent; class ArticleSubscriberTest extends TestCase @@ -654,4 +655,63 @@ public function testPersistPageDataOnReorder() $this->articleSubscriber->persistPageDataOnReorder($event->reveal()); } + + public function testHandleRemoveLocaleWithInvalidDocument() + { + $event = $this->prophesize(RemoveLocaleEvent::class); + $document = $this->prophesize(\stdClass::class); // Not an ArticleDocument + $event->getDocument()->willReturn($document->reveal()); + + // Ensure the indexer methods are not called + $this->indexer->replaceWithGhostData()->shouldNotBeCalled(); + $this->indexer->flush()->shouldNotBeCalled(); + + // Call the method and make sure it doesn't throw exceptions + $this->articleSubscriber->handleRemoveLocale($event->reveal()); + } + + public function testHandleRemoveLocale() + { + $event = $this->prophesize(RemoveLocaleEvent::class); + $document = $this->prophesize(ArticleDocument::class); + $event->getDocument()->willReturn($document->reveal()); + $event->getLocale()->willReturn('en'); + + // Ensure the indexer methods are called + $this->indexer->replaceWithGhostData($document->reveal(), 'en')->shouldBeCalled(); + $this->indexer->flush()->shouldBeCalled(); + + // Call the method + $this->articleSubscriber->handleRemoveLocale($event->reveal()); + } + + public function testHandleRemoveLocaleLiveWithInvalidDocument() + { + $event = $this->prophesize(RemoveLocaleEvent::class); + $document = $this->prophesize(\stdClass::class); // Not an ArticleDocument + $event->getDocument()->willReturn($document->reveal()); + + // Ensure the liveIndexer methods are not called + $this->liveIndexer->remove()->shouldNotBeCalled(); + $this->liveIndexer->flush()->shouldNotBeCalled(); + + // Call the method and make sure it doesn't throw exceptions + $this->articleSubscriber->handleRemoveLocaleLive($event->reveal()); + } + + public function testHandleRemoveLocaleLive() + { + // Create a mock RemoveLocaleEvent with an ArticleDocument + $event = $this->prophesize(RemoveLocaleEvent::class); + $document = $this->prophesize(ArticleDocument::class); + $event->getDocument()->willReturn($document->reveal()); + $event->getLocale()->willReturn('en'); + + // Ensure the liveIndexer methods are called + $this->liveIndexer->remove($document->reveal(), 'en')->shouldBeCalled(); + $this->liveIndexer->flush()->shouldBeCalled(); + + // Call the method + $this->articleSubscriber->handleRemoveLocaleLive($event->reveal()); + } } From eaaa8164ce65f12b1b2bbc75def610334e36a486 Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Thu, 14 Sep 2023 12:25:39 +0200 Subject: [PATCH 5/5] Update baseline --- phpstan-baseline.neon | 82 +------------------------------------------ 1 file changed, 1 insertion(+), 81 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 212e58ff..7b70dbe0 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -975,11 +975,6 @@ parameters: count: 1 path: Document/Index/ArticleIndexer.php - - - message: "#^If condition is always true\\.$#" - count: 1 - path: Document/Index/ArticleIndexer.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:__construct\\(\\) has parameter \\$typeConfiguration with no value type specified in iterable type array\\.$#" count: 1 @@ -1050,16 +1045,6 @@ parameters: count: 2 path: Document/Index/ArticleIndexer.php - - - message: "#^Parameter \\#1 \\$document of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:createOrUpdateArticle\\(\\) expects Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\ArticleDocument, object given\\.$#" - count: 1 - path: Document/Index/ArticleIndexer.php - - - - message: "#^Parameter \\#1 \\$document of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:dispatchIndexEvent\\(\\) expects Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\ArticleDocument, object given\\.$#" - count: 1 - path: Document/Index/ArticleIndexer.php - - message: "#^Parameter \\#1 \\$metadata of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:getType\\(\\) expects Sulu\\\\Component\\\\Content\\\\Metadata\\\\StructureMetadata, Sulu\\\\Component\\\\Content\\\\Metadata\\\\StructureMetadata\\|null given\\.$#" count: 2 @@ -1130,11 +1115,6 @@ parameters: count: 1 path: Document/Index/ArticleIndexer.php - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: Document/Index/ArticleIndexer.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\DocumentFactory\\:\\:__construct\\(\\) has parameter \\$documents with no value type specified in iterable type array\\.$#" count: 1 @@ -1245,11 +1225,6 @@ parameters: count: 1 path: Document/Initializer/ArticleInitializer.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Initializer\\\\ArticleNodeType\\:\\:getDeclaredSupertypeNames\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: Document/Initializer/ArticleNodeType.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Initializer\\\\ArticleNodeType\\:\\:getPrimaryItemName\\(\\) should return string but empty return statement found\\.$#" count: 1 @@ -1271,12 +1246,7 @@ parameters: path: Document/Initializer/ArticlePageNodeDefinition.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Initializer\\\\ArticlePageNodeDefinition\\:\\:getRequiredPrimaryTypeNames\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: Document/Initializer/ArticlePageNodeDefinition.php - - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Initializer\\\\ArticlePageNodeDefinition\\:\\:getRequiredPrimaryTypeNames\\(\\) should return array but returns null\\.$#" + message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Initializer\\\\ArticlePageNodeDefinition\\:\\:getRequiredPrimaryTypeNames\\(\\) should return array\\ but returns null\\.$#" count: 1 path: Document/Initializer/ArticlePageNodeDefinition.php @@ -1285,11 +1255,6 @@ parameters: count: 1 path: Document/Initializer/ArticlePageNodeDefinition.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Initializer\\\\ArticlePageNodeType\\:\\:getDeclaredSupertypeNames\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: Document/Initializer/ArticlePageNodeType.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Initializer\\\\ArticlePageNodeType\\:\\:getPrimaryItemName\\(\\) should return string but empty return statement found\\.$#" count: 1 @@ -1650,31 +1615,11 @@ parameters: count: 1 path: Document/Subscriber/ArticleSubscriber.php - - - message: "#^Cannot call method getIdentifier\\(\\) on mixed\\.$#" - count: 1 - path: Document/Subscriber/ArticleSubscriber.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\IndexerInterface\\:\\:remove\\(\\) invoked with 1 parameter, 2 required\\.$#" count: 2 path: Document/Subscriber/ArticleSubscriber.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\ArticleSubscriber\\:\\:getChildren\\(\\) has parameter \\$node with no value type specified in iterable type PHPCR\\\\NodeInterface\\.$#" - count: 1 - path: Document/Subscriber/ArticleSubscriber.php - - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\ArticleSubscriber\\:\\:getChildren\\(\\) return type has no value type specified in iterable type PHPCR\\\\NodeInterface\\.$#" - count: 1 - path: Document/Subscriber/ArticleSubscriber.php - - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\ArticleSubscriber\\:\\:getChildren\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: Document/Subscriber/ArticleSubscriber.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\ArticleSubscriber\\:\\:handleRemoveLocale\\(\\) has no return type specified\\.$#" count: 1 @@ -1685,11 +1630,6 @@ parameters: count: 1 path: Document/Subscriber/ArticleSubscriber.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\ArticleSubscriber\\:\\:loadPageDataForShadow\\(\\) has parameter \\$node with no value type specified in iterable type PHPCR\\\\NodeInterface\\.$#" - count: 1 - path: Document/Subscriber/ArticleSubscriber.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\ArticleSubscriber\\:\\:loadPageDataForShadow\\(\\) has parameter \\$originalPages with no value type specified in iterable type array\\.$#" count: 1 @@ -1710,11 +1650,6 @@ parameters: count: 1 path: Document/Subscriber/ArticleSubscriber.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\ArticleSubscriber\\:\\:setPageData\\(\\) has parameter \\$node with no value type specified in iterable type PHPCR\\\\NodeInterface\\.$#" - count: 1 - path: Document/Subscriber/ArticleSubscriber.php - - message: "#^Parameter \\#1 \\$document of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\IndexerInterface\\:\\:index\\(\\) expects Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\ArticleDocument, Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\ArticleDocument\\|null given\\.$#" count: 2 @@ -1800,16 +1735,6 @@ parameters: count: 2 path: Document/Subscriber/PageSubscriber.php - - - message: "#^Cannot call method getIdentifier\\(\\) on mixed\\.$#" - count: 1 - path: Document/Subscriber/PageSubscriber.php - - - - message: "#^Cannot call method setProperty\\(\\) on mixed\\.$#" - count: 1 - path: Document/Subscriber/PageSubscriber.php - - message: "#^Parameter \\#1 \\$pageNumber of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Behavior\\\\PageBehavior\\:\\:setPageNumber\\(\\) expects int, mixed given\\.$#" count: 1 @@ -2065,11 +1990,6 @@ parameters: count: 1 path: Import/ArticleImport.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Import\\\\ArticleImport\\:\\:importExtension\\(\\) has parameter \\$node with no value type specified in iterable type PHPCR\\\\NodeInterface\\.$#" - count: 1 - path: Import/ArticleImport.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Import\\\\ArticleImport\\:\\:importExtension\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1