-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathedit.php
More file actions
27 lines (22 loc) · 813 Bytes
/
edit.php
File metadata and controls
27 lines (22 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
declare(strict_types=1);
use Solid\App\BlogPost\Application\Edit\EditHandler;
use Solid\App\BlogPost\Application\Find\FindHandler;
use Solid\App\BlogPost\Domain\Serializer\ObjectSerializer;
use Solid\App\BlogPost\Infrastructure\Hydration\ObjectHydrator;
use Solid\App\BlogPost\Infrastructure\Storage\FileStorage;
use Solid\App\BlogPost\Presentation\Controller\EditAction;
use Solid\App\BlogPost\Presentation\Renderer\HtmlRenderer;
require __DIR__.'/../../../vendor/autoload.php';
$storage = new FileStorage(
__DIR__.'/../../../var/data/blog_post.dat',
new ObjectHydrator(),
new ObjectSerializer(),
);
$controller = new EditAction(
new FindHandler($storage),
new EditHandler($storage),
new HtmlRenderer(),
);
$response = $controller(intval($_GET['id'] ?? 0));
$response->send();