Completed
Pull Request — master (#2)
by René
05:31 queued 03:25
created

User::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
crap 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Zortje\MVC\User;
5
6
use Zortje\MVC\Model\Table\Entity\Entity;
7
8
/**
9
 * Class User
10
 *
11
 * @package Zortje\MVC\Model
12
 */
13
class User extends Entity
14
{
15
16
    protected static $columns = [
17
        'email'         => 'string',
18
        'password_hash' => 'string',
19
    ];
20
21
    /**
22
     * User constructor.
23
     *
24
     * @param string $email
25
     * @param string $passwordHash
26
     */
27
    public function __construct(string $email, string $passwordHash)
28
    {
29
        parent::__construct(null, new \DateTime(), new \DateTime());
30
31
        $this->set('email', $email);
32
        $this->set('password_hash', $passwordHash);
33
    }
34
}
35