Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix implicitly nullable parameter #690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Checkers/User/UserDefaultChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private function hidrateRole(string $class, Model|array $data): Role
/**
* Check if a role or permission is added to the user in a same team.
*/
private function isInSameTeam($rolePermission, int|string $teamId = null): bool
private function isInSameTeam($rolePermission, int|string|null $teamId = null): bool
{
if (
! Config::get('laratrust.teams.enabled')
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ public function givePermissions(iterable $permissions): static;
/**
* Detach multiple permissions from current role.
*/
public function removePermissions(iterable $permissions = null): static;
public function removePermissions(?iterable $permissions = null): static;
}
2 changes: 1 addition & 1 deletion src/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function givePermissions(iterable $permissions): static
return $this;
}

public function removePermissions(iterable $permissions = null): static
public function removePermissions(?iterable $permissions = null): static
{
if (! $permissions) {
$this->syncPermissions([]);
Expand Down