GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

UserTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 27
ccs 0
cts 5
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 7 1
1
<?php
2
3
namespace App\Api\V1\Transformers;
4
5
use App\Models\User;
6
use League\Fractal\TransformerAbstract;
7
8
class UserTransformer extends TransformerAbstract
9
{
10
    /**
11
     * List of resources possible to include.
12
     *
13
     * @var array
14
     */
15
    protected $availableIncludes = [];
16
17
    /**
18
     * List of resources to automatically include.
19
     *
20
     * @var array
21
     */
22
    protected $defaultIncludes = [];
23
24
    /**
25
     * @property string name
26
     * @property string email
27
     */
28
    public function transform(User $user)
29
    {
30
        return [
31
            'id' => $user->id,
32
            'name' => $user->name,
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on App\Models\User. Since you implemented __get, consider adding a @property annotation.
Loading history...
33
            'email' => $user->email,
0 ignored issues
show
Bug Best Practice introduced by
The property email does not exist on App\Models\User. Since you implemented __get, consider adding a @property annotation.
Loading history...
34
            'added' => date('Y-m-d', strtotime($user->created_at)),
0 ignored issues
show
Bug introduced by
$user->created_at of type DateTime is incompatible with the type string expected by parameter $time of strtotime(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

34
            'added' => date('Y-m-d', strtotime(/** @scrutinizer ignore-type */ $user->created_at)),
Loading history...
35
        ];
36
    }
37
}
38