Passed
Push — master ( e5b31a...cf340d )
by Arthur
04:48
created

Auth0ProfileValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 16
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validateRequiredAttributes() 0 3 1
A validate() 0 3 1
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
    public function validate(\stdClass $profile)
21
    {
22
        return $this->validateRequiredAttributes($profile);
23
    }
24
25
    private function validateRequiredAttributes(\stdClass $profile)
26
    {
27
        return array_keys_exists($this->requiredAttributes, (array)$profile);
28
    }
29
30
}
31