Skip to content

Commit

Permalink
Fix changed date for sitemape
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlagler committed Mar 18, 2024
1 parent 9798dd3 commit 41b8c02
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 37 deletions.
2 changes: 2 additions & 0 deletions Content/ArticleDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public function resolveDataItems(
$filters['types'] = $this->getTypesProperty($propertyParameter);
$filters['excluded'] = $this->getExcludedFilter($filters, $propertyParameter);

/** @var string|null $locale */
$locale = $options['locale'];
$webspaceKey = $this->getWebspaceKey($propertyParameter, $options);
$queryResult = $this->getSearchResult($filters, $limit, $page, $pageSize, $locale, $webspaceKey);
Expand Down Expand Up @@ -206,6 +207,7 @@ public function resolveResourceItems(
$filters['types'] = $this->getTypesProperty($propertyParameter);
$filters['excluded'] = $this->getExcludedFilter($filters, $propertyParameter);

/** @var string|null $locale */
$locale = $options['locale'];
$webspaceKey = $this->getWebspaceKey($propertyParameter, $options);
$queryResult = $this->getSearchResult($filters, $limit, $page, $pageSize, $locale, $webspaceKey);
Expand Down
4 changes: 3 additions & 1 deletion Content/PageTreeArticleDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function resolveDatasource($datasource, array $propertyParameter, array $
return null;
}

$document = $this->documentManager->find($datasource, $options['locale']);
/** @var string|null $locale */
$locale = $options['locale'];
$document = $this->documentManager->find($datasource, $locale);

if (!$document instanceof BasePageDocument) {
return null;
Expand Down
1 change: 1 addition & 0 deletions Sitemap/ArticleSitemapProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected function buildUrl(
return new SitemapUrl(
$this->findUrl($articleView, $scheme, $host, $webspaceKey),
$articleView->getLocale(),
null,
$articleView->getChanged()
);
}
Expand Down
47 changes: 11 additions & 36 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -170,36 +170,11 @@ parameters:
count: 1
path: Content/ArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataProvider\\:\\:resolveDataItems\\(\\) has parameter \\$filters with no value type specified in iterable type array\\.$#"
count: 1
path: Content/ArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataProvider\\:\\:resolveDataItems\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: Content/ArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataProvider\\:\\:resolveDatasource\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: Content/ArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataProvider\\:\\:resolveDatasource\\(\\) should return Sulu\\\\Component\\\\SmartContent\\\\DatasourceItemInterface but empty return statement found\\.$#"
count: 1
path: Content/ArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataProvider\\:\\:resolveResourceItems\\(\\) has parameter \\$filters with no value type specified in iterable type array\\.$#"
count: 1
path: Content/ArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataProvider\\:\\:resolveResourceItems\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: Content/ArticleDataProvider.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
Expand Down Expand Up @@ -280,18 +255,13 @@ parameters:
count: 1
path: Content/PageTreeArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\PageTreeArticleDataProvider\\:\\:resolveDatasource\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: Content/PageTreeArticleDataProvider.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\PageTreeArticleDataProvider\\:\\:resolveDatasource\\(\\) should return Sulu\\\\Component\\\\SmartContent\\\\DatasourceItemInterface but returns null\\.$#"
count: 2
path: Content/PageTreeArticleDataProvider.php

-
message: "#^Parameter \\#1 \\$identifier of method Sulu\\\\Component\\\\DocumentManager\\\\DocumentManagerInterface\\:\\:find\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#1 \\$identifier of method Sulu\\\\Component\\\\DocumentManager\\\\DocumentManagerInterface\\:\\:find\\(\\) expects string, int\\<min, \\-1\\>\\|int\\<1, max\\>\\|string given\\.$#"
count: 1
path: Content/PageTreeArticleDataProvider.php

Expand Down Expand Up @@ -2075,6 +2045,16 @@ parameters:
count: 1
path: Import/ImportResult.php

-
message: "#^Parameter \\#1 \\$filters of method Sulu\\\\Component\\\\SmartContent\\\\DataProviderInterface\\:\\:resolveResourceItems\\(\\) expects array\\{dataSource\\?\\: int\\|string\\|null, sortMethod\\?\\: 'asc'\\|'desc', sortBy\\?\\: string, tags\\?\\: array\\<string\\>, tagOperator\\?\\: 'and'\\|'or', types\\?\\: array\\<string\\>, categories\\?\\: array\\<int\\>, categoryOperator\\?\\: 'and'\\|'or', \\.\\.\\.\\}, array given\\.$#"
count: 1
path: Infrastructure/Sulu/Headless/DataProviderResolver/AbstractArticleDataProviderResolver.php

-
message: "#^Parameter \\#1 \\$filters of method Sulu\\\\Component\\\\SmartContent\\\\DataProviderInterface\\:\\:resolveResourceItems\\(\\) expects array\\{dataSource\\?\\: int\\|string\\|null, sortMethod\\?\\: 'asc'\\|'desc', sortBy\\?\\: string, tags\\?\\: array\\<string\\>, tagOperator\\?\\: 'and'\\|'or', types\\?\\: array\\<string\\>, categories\\?\\: array\\<int\\>, categoryOperator\\?\\: 'and'\\|'or', \\.\\.\\.\\}, array given\\.$#"
count: 1
path: Infrastructure/SuluHeadlessBundle/DataProviderResolver/AbstractArticleDataProviderResolver.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\ListBuilder\\\\ElasticSearchFieldDescriptorBuilder\\:\\:setSearchability\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -2385,11 +2365,6 @@ parameters:
count: 1
path: Sitemap/ArticleSitemapProvider.php

-
message: "#^Parameter \\#3 \\$defaultLocale of class Sulu\\\\Bundle\\\\WebsiteBundle\\\\Sitemap\\\\SitemapUrl constructor expects string\\|null, DateTime given\\.$#"
count: 1
path: Sitemap/ArticleSitemapProvider.php

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

0 comments on commit 41b8c02

Please sign in to comment.