trims title and body, rejects empty (post-trim) values with BadRequest. supplies createdAt from injected Clock. persists through PostRepository->create and returns the resulting Post. 44 tests pass.
12 lines
207 B
PHP
12 lines
207 B
PHP
<?php
|
|
|
|
namespace App\Post\UseCases\CreatePost;
|
|
|
|
class CreatePostRequest
|
|
{
|
|
public function __construct(
|
|
public int $userId,
|
|
public ?string $title,
|
|
public ?string $body,
|
|
) {}
|
|
}
|