Introduce typed DTOs and sub-namespaces for Micropub handlers

Each handler now declares the data class it needs via dataClass(). The
controller builds the appropriate typed DTO from the raw request array
before calling handle(), giving handlers typed property access instead
of raw array lookups.

Handlers moved to App\Services\Micropub\Handlers, data objects to
App\Services\Micropub\Data. MicropubHandlerRegistry and the interface
are documented with flow diagrams and guidance for adding new types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jonny Barnes 2026-02-22 10:41:33 +00:00
commit ad15b36f4d
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
12 changed files with 282 additions and 36 deletions

View file

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Services\Micropub\Data;
abstract class MicropubData
{
abstract public static function fromArray(array $data): static;
abstract public function toArray(): array;
}