CreatePermissionAction::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\Authorization\Actions;
4
5
use Apiato\Core\Foundation\Facades\Apiato;
6
use App\Containers\Authorization\Models\Permission;
7
use App\Ship\Parents\Actions\Action;
8
use App\Ship\Transporters\DataTransporter;
9
10
/**
11
 * Class CreatePermissionAction
12
 *
13
 * @author  Mahmoud Zalt  <[email protected]>
14
 */
15
class CreatePermissionAction extends Action
16
{
17
18
    /**
19
     * @param \App\Ship\Transporters\DataTransporter $data
20
     *
21
     * @return  \App\Containers\Authorization\Models\Permission
22
     */
23
    public function run(DataTransporter $data): Permission
24
    {
25
        $permission = Apiato::call('[email protected]',
26
            [$data->name, $data->description, $data->display_name]
27
        );
28
29
        return $permission;
30
    }
31
}
32