Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni committed Jul 20, 2024
1 parent 9b296cd commit 5219c51
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/Sitemaps/BaseSitemapUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ abstract public function priority(): string|self|null;

abstract public function site(): string|self;

// TODO: Can we use the canonicalPointsToAnotherUrl method instead? It's the same logic.
public function isCanonicalUrl(): bool
public function canonicalTypeIsCurrent(): bool
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sitemaps/Collections/CollectionSitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function urls(): Collection

return $this->urls = $this->entries()
->map(fn ($entry) => new EntrySitemapUrl($entry, $this))
->filter(fn ($url) => $url->isCanonicalUrl());
->filter(fn ($url) => $url->canonicalTypeIsCurrent());
}

protected function entries(): Collection
Expand Down
2 changes: 1 addition & 1 deletion src/Sitemaps/Collections/EntrySitemapUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function site(): string
return $this->entry->locale();
}

public function isCanonicalUrl(): bool
public function canonicalTypeIsCurrent(): bool
{
return $this->entry->seo_canonical_type == 'current';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sitemaps/Taxonomies/TaxonomySitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function urls(): Collection
->merge($this->termUrls())
->merge($this->collectionTaxonomyUrls())
->merge($this->collectionTermUrls())
->filter(fn ($url) => $url->isCanonicalUrl());
->filter(fn ($url) => $url->canonicalTypeIsCurrent());
}

protected function taxonomyUrls(): Collection
Expand Down
2 changes: 1 addition & 1 deletion src/Sitemaps/Taxonomies/TermSitemapUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function site(): string
return $this->term->locale();
}

public function isCanonicalUrl(): bool
public function canonicalTypeIsCurrent(): bool
{
return $this->term->seo_canonical_type == 'current';
}
Expand Down

0 comments on commit 5219c51

Please sign in to comment.