- Add MicropubUnsupportedModelException for non-note update attempts - Refactor UpdateHandler to throw exceptions instead of returning JsonResponse objects; extract applySyndication() to DRY up duplicated syndication URL mapping - Fix MicropubController: InvalidTokenScopeException now returns 401 + insufficient_scope; add catches for ModelNotFoundException (404) and MicropubUnsupportedModelException (500); updates return 200 not 201 - Slim MicropubRequest.normalizeMicropubJson() to branch on action type, keeping update and create fields cleanly separated - Update tests to match corrected status codes and error keys; remove markTestSkipped() from all update tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
764 B
PHP
28 lines
764 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\Micropub\CardHandler;
|
|
use App\Services\Micropub\EntryHandler;
|
|
use App\Services\Micropub\MicropubHandlerRegistry;
|
|
use App\Services\Micropub\UpdateHandler;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class MicropubServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(MicropubHandlerRegistry::class, function () {
|
|
$registry = new MicropubHandlerRegistry;
|
|
|
|
// Register handlers
|
|
$registry->register('card', new CardHandler);
|
|
$registry->register('entry', new EntryHandler);
|
|
$registry->register('update', new UpdateHandler);
|
|
|
|
return $registry;
|
|
});
|
|
}
|
|
}
|