From bec39c3c8b2fc59e683bf971e55fa36d9725a98b Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Thu, 17 Apr 2025 09:08:31 -0400 Subject: [PATCH] Document a bit, start on file handler interface. --- app/phinx.php | 3 +-- app/public/static/js/register.js | 1 - app/src/Domain/Aggregate/ChannelAggregate.php | 12 +++++++++-- .../Aggregate/ChannelAggregateInterface.php | 4 ++++ app/src/Feed/FeedGeneratorInterface.php | 5 +++-- .../Api/File/FileHandlerInterface.php | 21 +++++++++++++++++++ 6 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 app/src/Infrastructure/Api/File/FileHandlerInterface.php diff --git a/app/phinx.php b/app/phinx.php index 4565ffd..abeaea6 100644 --- a/app/phinx.php +++ b/app/phinx.php @@ -1,7 +1,6 @@ [ 'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations', 'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds' diff --git a/app/public/static/js/register.js b/app/public/static/js/register.js index 1c0d52f..41a05ea 100644 --- a/app/public/static/js/register.js +++ b/app/public/static/js/register.js @@ -8,7 +8,6 @@ if (form) { const p2 = document.querySelector('input[name="checked_password"]'); if (p1.value == p2.value) { - console.log("Passwords match"); form.submit(); } else { console.log("Passwords do not match"); diff --git a/app/src/Domain/Aggregate/ChannelAggregate.php b/app/src/Domain/Aggregate/ChannelAggregate.php index 6ae97b8..6431f65 100644 --- a/app/src/Domain/Aggregate/ChannelAggregate.php +++ b/app/src/Domain/Aggregate/ChannelAggregate.php @@ -7,14 +7,22 @@ use Slovocast\Domain\Entity\Channel; class ChannelAggregate implements ChannelAggregateInterface { + protected Channel $channel; + + /** + * @var array $episodes + */ + protected array $episodes; + /** * @param Channel $channel * @param array $episodes */ public function __construct( - protected Channel $channel, - protected array $episodes + Channel $channel, + array $episodes ) { + $this->channel = $channel; $this->setEpisodes($episodes); } diff --git a/app/src/Domain/Aggregate/ChannelAggregateInterface.php b/app/src/Domain/Aggregate/ChannelAggregateInterface.php index b245e1f..c45aa27 100644 --- a/app/src/Domain/Aggregate/ChannelAggregateInterface.php +++ b/app/src/Domain/Aggregate/ChannelAggregateInterface.php @@ -14,6 +14,10 @@ interface ChannelAggregateInterface */ public function getEpisodes(): array; public function hasEpisodes(): bool; + + /** + * Appends an episode to the existing list + */ public function addEpisode(Episode $episode): void; /** diff --git a/app/src/Feed/FeedGeneratorInterface.php b/app/src/Feed/FeedGeneratorInterface.php index 6a3395e..b886d73 100644 --- a/app/src/Feed/FeedGeneratorInterface.php +++ b/app/src/Feed/FeedGeneratorInterface.php @@ -9,8 +9,9 @@ interface FeedGeneratorInterface { /** * XMLNS Definitions that should be updated as new namespaces get added. - * This could probably be defines somewhere else if we need it. These are - * pulled from some old Podbean feeds. + * This could probably be defined somewhere else if we need it. These are + * pulled from some old Podbean feeds - so we should probably fine another + * source for the definitive list */ const XMLNS_CONTENT="http://purl.org/rss/1.0/modules/content/"; const XMLNS_WFW="http://wellformedweb.org/CommentAPI"; diff --git a/app/src/Infrastructure/Api/File/FileHandlerInterface.php b/app/src/Infrastructure/Api/File/FileHandlerInterface.php new file mode 100644 index 0000000..9029668 --- /dev/null +++ b/app/src/Infrastructure/Api/File/FileHandlerInterface.php @@ -0,0 +1,21 @@ +