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.
Passed
Push — master ( 21b11b...ee56ef )
by Tharindu
03:47
created

UserTransformer::includeRoles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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