PostFormatter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 2
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
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 2
    public function format(Post $post): array
20
    {
21
        return [
22 2
            'id' => $post->getId(),
23 2
            'title' => $post->getTitle(),
24 2
            'content' => $post->getContent(),
25
        ];
26
    }
27
}
28