Code Duplication    Length = 13-13 lines in 2 locations

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

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

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

@@ 95-107 (lines=13) @@
92
     * @return mixed
93
     * @throws LevelNotFoundException
94
     */
95
    protected function getALevel($level)
96
    {
97
        if (is_string($level))
98
            $level = config('laravel-acl.level', Level::class)::whereName($level)->first();
99
100
        if (is_int($level))
101
            $level = config('laravel-acl.level', Level::class)::find($level);
102
103
        if (!$level)
104
            throw new LevelNotFoundException();
105
106
        return $level;
107
    }
108
}