Completed
Push — master ( a54fa8...fcdb22 )
by Antonio
04:50
created

ResetPasswordService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
3
/*
4
 * This file is part of the 2amigos/yii2-usuario project.
5
 *
6
 * (c) 2amigOS! <http://2amigos.us/>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace Da\User\Service;
13
14
use Da\User\Contracts\ServiceInterface;
15
use Da\User\Helper\SecurityHelper;
16
use Da\User\Model\User;
17
18
class ResetPasswordService implements ServiceInterface
19
{
20
    protected $password;
21
    protected $model;
22
    protected $securityHelper;
23
24 1
    public function __construct($password, User $model, SecurityHelper $securityHelper)
25
    {
26 1
        $this->password = $password;
27 1
        $this->model = $model;
28 1
        $this->securityHelper = $securityHelper;
29 1
    }
30
31 1
    public function run()
32
    {
33 1
        $this->model->password = $this->password;
34 1
        return (bool)$this->model->save(false, ['password_hash']);
35
    }
36
}
37