Skip to content

Commit

Permalink
Respect webspaces when calculating the maximum number of sitemap pages (
Browse files Browse the repository at this point in the history
#642)

* respect webspaces when calculating the maximum number of sitemap pages
* Fix baseline errors

---------

Co-authored-by: Alexander Schranz <[email protected]>
  • Loading branch information
xabbuh and alexander-schranz authored Aug 7, 2023
1 parent 8f7c2d8 commit 4b29887
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 55 deletions.
2 changes: 2 additions & 0 deletions Sitemap/ArticleSitemapProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ public function getMaxPage($schema, $host)
$webspaceQuery->add(new TermQuery('additional_webspaces', $webspaceKey), BoolQuery::SHOULD);
}

$search->addQuery($webspaceQuery);

return \ceil($repository->count($search) / static::PAGE_SIZE);
}

Expand Down
60 changes: 5 additions & 55 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,11 @@ parameters:
count: 1
path: Builder/ArticleIndexBuilder.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Command\\\\ArticleExportCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
count: 1
path: Command/ArticleExportCommand.php

-
message: "#^Strict comparison using \\=\\=\\= between 0 and bool will always evaluate to false\\.$#"
count: 1
path: Command/ArticleExportCommand.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Command\\\\ArticleImportCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
count: 1
path: Command/ArticleImportCommand.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Command\\\\ArticleImportCommand\\:\\:printExceptions\\(\\) has no return type specified\\.$#"
count: 1
Expand All @@ -70,11 +60,6 @@ parameters:
count: 1
path: Command/ArticleImportCommand.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Command\\\\ReindexCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
count: 1
path: Command/ReindexCommand.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Command\\\\ReindexCommand\\:\\:getDocuments\\(\\) should return Sulu\\\\Component\\\\DocumentManager\\\\Collection\\\\QueryResultCollection but returns mixed\\.$#"
count: 1
Expand Down Expand Up @@ -535,21 +520,6 @@ parameters:
count: 1
path: Controller/WebsiteArticleController.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\DependencyInjection\\\\ConverterCompilerPass\\:\\:process\\(\\) has no return type specified\\.$#"
count: 1
path: DependencyInjection/ConverterCompilerPass.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\DependencyInjection\\\\RouteEnhancerCompilerPass\\:\\:process\\(\\) has no return type specified\\.$#"
count: 1
path: DependencyInjection/RouteEnhancerCompilerPass.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\DependencyInjection\\\\StructureValidatorCompilerPass\\:\\:process\\(\\) has no return type specified\\.$#"
count: 1
path: DependencyInjection/StructureValidatorCompilerPass.php

-
message: "#^Negated boolean expression is always true\\.$#"
count: 1
Expand Down Expand Up @@ -590,11 +560,6 @@ parameters:
count: 1
path: DependencyInjection/SuluArticleExtension.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\DependencyInjection\\\\SuluArticleExtension\\:\\:prepend\\(\\) has no return type specified\\.$#"
count: 1
path: DependencyInjection/SuluArticleExtension.php

-
message: "#^Offset 'article' on array\\{snippet\\: string\\} in isset\\(\\) does not exist\\.$#"
count: 1
Expand Down Expand Up @@ -960,21 +925,11 @@ parameters:
count: 1
path: Document/Form/ArticleDocumentType.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Form\\\\ArticleDocumentType\\:\\:configureOptions\\(\\) has no return type specified\\.$#"
count: 1
path: Document/Form/ArticleDocumentType.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Form\\\\ArticlePageDocumentType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: Document/Form/ArticlePageDocumentType.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Form\\\\ArticlePageDocumentType\\:\\:configureOptions\\(\\) has no return type specified\\.$#"
count: 1
path: Document/Form/ArticlePageDocumentType.php

-
message: "#^Cannot access offset 'structure' on mixed\\.$#"
count: 2
Expand All @@ -995,11 +950,6 @@ parameters:
count: 1
path: Document/Form/Listener/DataNormalizer.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Form\\\\UnstructuredType\\:\\:configureOptions\\(\\) has no return type specified\\.$#"
count: 1
path: Document/Form/UnstructuredType.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleGhostIndexer\\:\\:__construct\\(\\) has parameter \\$typeConfiguration with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -1690,6 +1640,11 @@ parameters:
count: 1
path: Document/Subscriber/ArticleSubscriber.php

-
message: "#^Cannot access offset int\\<0, max\\> on mixed\\.$#"
count: 1
path: Document/Subscriber/ArticleSubscriber.php

-
message: "#^Cannot call method getIdentifier\\(\\) on mixed\\.$#"
count: 1
Expand Down Expand Up @@ -2510,11 +2465,6 @@ parameters:
count: 1
path: Sitemap/ArticleSitemapProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\SuluArticleBundle\\:\\:build\\(\\) has no return type specified\\.$#"
count: 1
path: SuluArticleBundle.php

-
message: "#^Cannot call method getExcerpt\\(\\) on mixed\\.$#"
count: 1
Expand Down

0 comments on commit 4b29887

Please sign in to comment.