Completed
Push — master ( 63d559...0e0340 )
by Mahmoud
03:20
created

DeleteUserAction::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace App\Containers\User\Actions;
4
5
use App\Containers\Authentication\Tasks\GetAuthenticatedUserTask;
6
use App\Containers\User\Tasks\DeleteUserTask;
7
use App\Ship\Parents\Actions\Action;
8
9
/**
10
 * Class DeleteUserAction.
11
 *
12
 * @author Mahmoud Zalt <[email protected]>
13
 */
14
class DeleteUserAction extends Action
15
{
16
17
    /**
18
     * @param $userId
19
     *
20
     * @return  bool
21
     */
22
    public function run($userId = null)
23
    {
24
        $userId = $userId ? : $this->call(GetAuthenticatedUserTask::class)->id;
25
26
        $isDeleted = $this->call(DeleteUserTask::class, [$userId]);
27
28
        return $isDeleted;
29
    }
30
}
31