Code Duplication    Length = 13-13 lines in 2 locations

src/z1haze/Acl/Traits/UserAndLevel.php 1 location

@@ 473-485 (lines=13) @@
470
     * @return mixed
471
     * @throws PermissionNotFoundException
472
     */
473
    protected function getPermission($permission)
474
    {
475
        if (is_string($permission))
476
            $permission = config('laravel-acl.permission', Permission::class)::whereName($permission)->first();
477
478
        if (is_int($permission))
479
            $permission = config('laravel-acl.permission', Permission::class)::find($permission);
480
481
        if (!$permission)
482
            throw new PermissionNotFoundException;
483
484
        return $permission;
485
    }
486
}

src/z1haze/Acl/Traits/UserAndPermission.php 1 location

@@ 60-72 (lines=13) @@
57
     * @return mixed
58
     * @throws LevelNotFoundException
59
     */
60
    protected function getLevel($level)
61
    {
62
        if (is_string($level))
63
            $level = config('laravel-acl.level', Level::class)::whereName($level)->first();
64
65
        if (is_int($level))
66
            $level = config('laravel-acl.level', Level::class)::find($level);
67
68
        if (!$level)
69
            throw new LevelNotFoundException();
70
71
        return $level;
72
    }
73
}