Completed
Push — master ( a206dc...d306f8 )
by Derek Stephen
02:37
created

User   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 1
b 0
f 0
ccs 2
cts 2
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A verifyPassword() 0 4 1
A toArray() 0 7 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: DM0C60544
5
 * Date: 21/3/2017
6
 * Time: 4:17 PM
7
 */
8
9
namespace OAuth;
10
11
use Del\Entity\User as UserEntity;
12
use OAuth\Traits\EncryptableFieldEntity;
13
14
/**
15
 * @MappedSuperclass(repositoryClass="OAuth\Repository\UserRepository")
16
 */
17
class User extends UserEntity
18
{
19
    use EncryptableFieldEntity;
20
21
    /**
22 1
     * Verify user's password
23
     *
24 1
     * @param string $password
25
     * @return Boolean
26
     */
27
    public function verifyPassword($password)
28
    {
29
        return $this->verifyEncryptedFieldValue($this->getPassword(), $password);
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    public function toArray()
36
    {
37
        return [
38
            'user_id' => $this->getID(),
39
            'scope' => null,
40
        ];
41
    }
42
}