Skip to content

Commit

Permalink
Dynamic properties are deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni committed Jul 10, 2024
1 parent e574841 commit 1db3390
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Sitemap/CustomSitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class CustomSitemap extends BaseSitemap
{
protected Collection $urls;

public function __construct(protected string $handle)
{
$this->urls = collect();
Expand Down
11 changes: 10 additions & 1 deletion src/Sitemap/CustomSitemapUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ class CustomSitemapUrl extends BaseSitemapUrl
{
use FluentlyGetsAndSets;

public function __construct(protected string $loc) {}
public function __construct(
protected string $loc,
protected ?string $alternates = null,
protected ?string $lastmod = null,
protected ?string $changefreq = null,
protected ?string $priority = null,
protected ?string $site = null,
)
{
}

public function loc(?string $loc = null): string|self
{
Expand Down

0 comments on commit 1db3390

Please sign in to comment.