Skip to content

Commit

Permalink
fix PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 committed May 26, 2023
1 parent 563794f commit 6926349
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Models/Permission.php
Expand Up @@ -34,6 +34,11 @@ public function __construct(array $attributes = [])
$this->table = config('permission.table_names.permissions') ?: parent::getTable();
}

/**
* @return PermissionContract|Permission
*
* @throws PermissionAlreadyExists
*/
public static function create(array $attributes = [])
{
$attributes['guard_name'] = $attributes['guard_name'] ?? Guard::getDefaultName(static::class);
Expand Down
10 changes: 9 additions & 1 deletion src/Models/Role.php
Expand Up @@ -35,6 +35,11 @@ public function __construct(array $attributes = [])
$this->table = config('permission.table_names.roles') ?: parent::getTable();
}

/**
* @return RoleContract|Role
*
* @throws RoleAlreadyExists
*/
public static function create(array $attributes = [])
{
$attributes['guard_name'] = $attributes['guard_name'] ?? Guard::getDefaultName(static::class);
Expand Down Expand Up @@ -143,7 +148,10 @@ public static function findOrCreate(string $name, $guardName = null): RoleContra
return $role;
}

protected static function findByParam(array $params = [])
/**
* Finds a role based on an array of parameters.
*/
protected static function findByParam(array $params = []): ?RoleContract
{
$query = static::query();

Expand Down

0 comments on commit 6926349

Please sign in to comment.