Code Duplication    Length = 13-13 lines in 2 locations

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
101
        if (is_int($level)) {
102
            $level = config('laravel-acl.level', Level::class)::find($level);
103
        }
104
105
        if (!$level) {
106
            throw new LevelNotFoundException();
107
        }
108
109
        return $level;
110
    }

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

@@ 479-491 (lines=13) @@
476
     * @return \z1haze\Acl\Models\Permission
477
     * @throws PermissionNotFoundException
478
     */
479
    protected function getPermission($permission)
480
    {
481
        if (is_string($permission)) {
482
            $permission = config('laravel-acl.permission', Permission::class)::whereName($permission)->first();
483
        }
484
485
        if (is_int($permission)) {
486
            $permission = config('laravel-acl.permission', Permission::class)::find($permission);
487
        }
488
489
        if (!$permission) {
490
            throw new PermissionNotFoundException;
491
        }
492
493
        return $permission;
494
    }