Auth0GoogleProfileTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 9
ccs 0
cts 9
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 13.10.18
6
 * Time: 19:06.
7
 */
8
9
namespace Modules\Auth0\Transformers;
10
11
use Modules\Auth0\Abstracts\Auth0IdentityProviderTransformer;
12
13
class Auth0GoogleProfileTransformer extends Auth0IdentityProviderTransformer
14
{
15
    public function transform($profile): array
16
    {
17
        return [
18
            'email'          => $profile->email,
19
            'name'           => $profile->name,
20
            'gender'         => $profile->gender ?? 'unknown',
21
            'username'       => $profile->nickname ?? 'stranger',
22
            'avatar'         => $profile->picture,
23
            'email_verified' => $profile->email_verified,
24
        ];
25
    }
26
}
27