UserFormatter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 3
b 0
f 0
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\User;
6
7
use OpenApi\Annotations as OA;
8
9
/**
10
 * @OA\Schema(
11
 *      schema="User",
12
 *      @OA\Property(example="UserName", property="login", format="string"),
13
 *      @OA\Property(example="13.12.2020 00:04:20", property="created_at", format="string"),
14
 * )
15
 */
16
final class UserFormatter
17
{
18 2
    public function format(User $user): array
19
    {
20
        return [
21 2
            'login' => $user->getLogin(),
22
            'created_at' => $user
23 2
                ->getCreatedAt()
24 2
                ->format('d.m.Y H:i:s'),
25
        ];
26
    }
27
}
28