Passed
Push — master ( 0c5e09...b94ee9 )
by Arthur
08:40 queued 02:13
created

Auth0ProfileValidator::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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
12
abstract class Auth0ProfileValidator
13
{
14
    protected $requiredAttributes = [
15
        "email",
16
        "name",
17
        "picture"
18
    ];
19
20 9
    public function validate(\stdClass $profile)
21
    {
22 9
        return $this->validateRequiredAttributes($profile);
23
    }
24
25 9
    private function validateRequiredAttributes(\stdClass $profile)
26
    {
27 9
        return array_keys_exists($this->requiredAttributes, (array)$profile);
28
    }
29
30
}
31