CreatePasswordResetTask   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 8 2
1
<?php
2
3
namespace App\Containers\User\Tasks;
4
5
use App\Containers\User\Models\User;
6
use App\Ship\Exceptions\InternalErrorException;
7
use App\Ship\Parents\Exceptions\Exception;
8
use App\Ship\Parents\Tasks\Task;
9
10
/**
11
 * Class CreatePasswordResetTask
12
 *
13
 * @author  Sebastian Weckend
14
 */
15
class CreatePasswordResetTask extends Task
16
{
17
18
    /**
19
     * @param \App\Containers\User\Models\User $user
20
     *
21
     * @return mixed
22
     * @throws InternalErrorException
23
     */
24
    public function run(User $user)
25
    {
26
        try {
27
            return app('auth.password.broker')->createToken($user);
28
        } catch (Exception $e) {
29
            throw new InternalErrorException();
30
        }
31
    }
32
}
33