From f56df395af92d7554b9e61eb68cb188912fca56d Mon Sep 17 00:00:00 2001 From: Stefan Doorn Date: Sat, 14 Oct 2017 15:21:59 +0200 Subject: [PATCH] Be more strict on alternative URLs input (demand string) --- src/Model/SitemapUrl.php | 4 ++-- src/Model/SitemapUrlInterface.php | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Model/SitemapUrl.php b/src/Model/SitemapUrl.php index ae88ffb9..7897cb00 100644 --- a/src/Model/SitemapUrl.php +++ b/src/Model/SitemapUrl.php @@ -38,7 +38,7 @@ class SitemapUrl implements SitemapUrlInterface /** * {@inheritdoc} */ - public function addAlternative($location, $locale): void + public function addAlternative(string $location, string $locale): void { $this->alternatives[$locale] = $location; } @@ -46,7 +46,7 @@ public function addAlternative($location, $locale): void /** * {@inheritdoc} */ - public function setAlternatives(array $alternatives): void + public function setAlternatives(iterable $alternatives): void { $this->alternatives = $alternatives; } diff --git a/src/Model/SitemapUrlInterface.php b/src/Model/SitemapUrlInterface.php index 14e28dd5..6c22d539 100644 --- a/src/Model/SitemapUrlInterface.php +++ b/src/Model/SitemapUrlInterface.php @@ -21,17 +21,18 @@ public function getLocalization(): ?string; public function setLocalization(string $localization): void; /** - * {@inheritdoc} + * @param string $location + * @param string $locale */ - public function addAlternative($location, $locale): void; + public function addAlternative(string $location, string $locale): void; /** - * {@inheritdoc} + * @param iterable $alternatives */ - public function setAlternatives(array $alternatives): void; + public function setAlternatives(iterable $alternatives): void; /** - * {@inheritdoc} + * @return iterable */ public function getAlternatives(): iterable; @@ -46,7 +47,7 @@ public function getLastModification(): ?DateTimeInterface; public function setLastModification(DateTimeInterface $lastModification): void; /** - * @return ChangeFrequency + * @return string */ public function getChangeFrequency(): string;