Test Failed
Push — master ( 09a5f1...c566a2 )
by Alexander
12:51
created

PostFormatter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 2
b 0
f 0
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Blog;
6
7
use OpenApi\Annotations as OA;
8
9
/**
10
 * @OA\Schema(
11
 *      schema="Post",
12
 *      @OA\Property(example="100", property="id", format="int"),
13
 *      @OA\Property(example="Title", property="title", format="string"),
14
 *      @OA\Property(example="Text", property="content", format="string"),
15
 * )
16
 */
17
final class PostFormatter
18
{
19
    public function format(Post $post): array
20
    {
21
        return [
22
            'id' => $post->getId(),
23
            'title' => $post->getTitle(),
24
            'content' => $post->getContent(),
25
        ];
26
    }
27
}
28