Passed
Push — master ( 9234be...3143c1 )
by Arthur
20:30
created

validateRequiredAttributes()   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 3
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: 20:31.
7
 */
8
9
namespace Modules\Auth0\Abstracts;
10
11
abstract class Auth0ProfileValidator
12
{
13
    protected $requiredAttributes = [
14
        'email',
15
        'name',
16
        'picture',
17
    ];
18
19
    public function validate(\stdClass $profile)
20
    {
21
        return $this->validateRequiredAttributes($profile);
22
    }
23
24
    private function validateRequiredAttributes(\stdClass $profile)
25
    {
26
        return array_keys_exists($this->requiredAttributes, (array) $profile);
27
    }
28
}
29