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

UserFormatter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 5 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
    public function format(User $user): array
19
    {
20
        return [
21
            'login' => $user->getLogin(),
22
            'created_at' => $user->getCreatedAt()->format('d.m.Y H:i:s'),
23
        ];
24
    }
25
}
26