Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 473-485 (lines=13) @@
470
     * @return \z1haze\Acl\Models\Permission
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

@@ 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
}