Skip to content

Commit

Permalink
fix phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Sep 21, 2023
1 parent af1eab3 commit 51de53c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Normalizer/LocalizedResourceNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ protected function normalizePage(ContextDefinitionInterface $contextDefinition,
$documentLocale = $document->getProperty('language');

if (empty($documentLocale)) {

if ($this->options['skip_not_localized_documents'] === false) {
throw new NormalizerException(sprintf('Cannot determinate locale aware document id "%s": no language property given.', $document->getId()));
} else {
return [];
}

return [];
}

$documentId = sprintf('%s_%s_%d', 'document', $documentLocale, $document->getId());
Expand Down Expand Up @@ -141,14 +142,11 @@ protected function generateResourceMetaFromHtmlResource(SpiderResource $resource
$contentLanguage = strtolower(str_replace('-', '_', $contentLanguage));

if (empty($contentLanguage)) {

if ($this->options['skip_not_localized_documents'] === false) {
throw new NormalizerException(sprintf('Cannot determinate locale aware document id "%s": no language property given.', $resourceId));
} else {
return null;
}
}

if (empty($contentLanguage)) {
return null;
}

Expand Down

0 comments on commit 51de53c

Please sign in to comment.