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

User::setPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 1
eloc 4
nc 1
nop 1
crap 2
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
}