Code Duplication    Length = 13-13 lines in 2 locations

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
}

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

@@ 461-473 (lines=13) @@
458
     * @return mixed
459
     * @throws PermissionNotFoundException
460
     */
461
    protected function getPermission($permission)
462
    {
463
        if (is_string($permission))
464
            $permission = config('laravel-acl.permission', Permission::class)::whereName($permission)->first();
465
466
        if (is_int($permission))
467
            $permission = config('laravel-acl.permission', Permission::class)::find($permission);
468
469
        if (!$permission)
470
            throw new PermissionNotFoundException;
471
472
        return $permission;
473
    }
474
}