Skip to content

Commit

Permalink
Be more strict on alternative URLs input (demand string)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandoorn committed Oct 14, 2017
1 parent 3adc13a commit f56df39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Model/SitemapUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ class SitemapUrl implements SitemapUrlInterface
/**
* {@inheritdoc}
*/
public function addAlternative($location, $locale): void
public function addAlternative(string $location, string $locale): void
{
$this->alternatives[$locale] = $location;
}

/**
* {@inheritdoc}
*/
public function setAlternatives(array $alternatives): void
public function setAlternatives(iterable $alternatives): void
{
$this->alternatives = $alternatives;
}
Expand Down
13 changes: 7 additions & 6 deletions src/Model/SitemapUrlInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -46,7 +47,7 @@ public function getLastModification(): ?DateTimeInterface;
public function setLastModification(DateTimeInterface $lastModification): void;

/**
* @return ChangeFrequency
* @return string
*/
public function getChangeFrequency(): string;

Expand Down

0 comments on commit f56df39

Please sign in to comment.