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

UserFormatter::format()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 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