Add PropertyFromHttp trait and update codebase to use new pattern

This commit is contained in:
Alex Cabal 2024-11-10 22:23:43 -06:00
parent c35c47b793
commit acb30b897c
47 changed files with 851 additions and 527 deletions

View file

@ -14,8 +14,8 @@ abstract class Feed{
public $Entries = [];
public string $Path;
public ?string $Stylesheet = null;
protected ?string $XmlString = null;
public ?DateTimeImmutable $Updated = null;
protected string $_XmlString;
public DateTimeImmutable $Updated;
/**
* @param string $title
@ -31,6 +31,13 @@ abstract class Feed{
}
// *******
// GETTERS
// *******
abstract protected function GetXmlString(): string;
// *******
// METHODS
// *******
@ -52,11 +59,6 @@ abstract class Feed{
return $output;
}
protected function GetXmlString(): string{
// Virtual function, meant to be implemented by subclass
return '';
}
public function Save(): void{
$feed = $this->GetXmlString();