Skip to content

Commit

Permalink
Merge pull request #294 from jackbayliss/hotfix/reorder-set-page-attr…
Browse files Browse the repository at this point in the history
…ibutes

Reorders set page attributes
  • Loading branch information
jackbayliss authored Nov 5, 2024
2 parents bfdd9bc + cb2b7cb commit e649499
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Writer/Entity/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function setSitemap(?float $sitemapPriority = null, bool $sitemapIncluded
$this->sitemapChangeFrequency = $sitemapChangeFrequency;
}

public function setPageAttributes(?string $pageTitle = null, ?string $pageDescription = null, ?string $pageKeywords = null, ?string $pageUrl = null): void
public function setPageAttributes(?string $pageTitle = null, ?string $pageDescription = null, ?string $pageUrl = null, ?string $pageKeywords = null): void
{
$this->pageAttributes = [
'page-title' => $pageTitle,
Expand Down
2 changes: 1 addition & 1 deletion src/Writer/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function setSitemap(?float $sitemapPriority = null, bool $sitemapIncluded
$this->sitemapChangeFrequency = $sitemapChangeFrequency;
}

public function setPageAttributes(?string $pageTitle, ?string $pageDescription, ?string $pageKeywords, ?string $pageUrl): void
public function setPageAttributes(?string $pageTitle = null, ?string $pageDescription = null, ?string $pageUrl = null, ?string $pageKeywords = null): void
{
$this->pageAttributes = [
'page-title' => $pageTitle,
Expand Down
2 changes: 1 addition & 1 deletion tests/Writer/CategoriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function test_categories_xml(): void
$element->setTemplate('cat-listings.html');
$element->setOnlineFlag(true);
$element->setSitemap(0.2);
$element->setPageAttributes($title, 'Buy ' . $title, mb_strtolower($title), '/' . $title);
$element->setPageAttributes($title, 'Buy ' . $title, '/' . $title, mb_strtolower($title));
$element->setOnlineFromTo(
$data['dates']['from'],
$data['dates']['to']
Expand Down
2 changes: 1 addition & 1 deletion tests/Writer/ProductsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ protected function buildBaseElement(string $type, int $number = 0): Product
$element->setPageAttributes(
'Amazing ' . $type,
'Buy our ' . $type . ' today!',
'http://example.com/' . mb_strtolower($type) . '/123',
$type . ', test, example',
'http://example.com/' . mb_strtolower($type) . '/123'
);

$element->addCustomAttributes([
Expand Down

0 comments on commit e649499

Please sign in to comment.