Skip to content

Commit f0b90fc

Browse files
authored
Fix implicitly nullable parameter (#690)
Starting PHP 8.4, implicitly nullable parameter will trigger a deprecated message. And will remove the support in PHP 9 per RFC https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
1 parent ca3f84b commit f0b90fc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Checkers/User/UserDefaultChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private function hidrateRole(string $class, Model|array $data): Role
227227
/**
228228
* Check if a role or permission is added to the user in a same team.
229229
*/
230-
private function isInSameTeam($rolePermission, int|string $teamId = null): bool
230+
private function isInSameTeam($rolePermission, int|string|null $teamId = null): bool
231231
{
232232
if (
233233
! Config::get('laratrust.teams.enabled')

src/Contracts/Role.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ public function givePermissions(iterable $permissions): static;
5353
/**
5454
* Detach multiple permissions from current role.
5555
*/
56-
public function removePermissions(iterable $permissions = null): static;
56+
public function removePermissions(?iterable $permissions = null): static;
5757
}

src/Models/Role.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function givePermissions(iterable $permissions): static
152152
return $this;
153153
}
154154

155-
public function removePermissions(iterable $permissions = null): static
155+
public function removePermissions(?iterable $permissions = null): static
156156
{
157157
if (! $permissions) {
158158
$this->syncPermissions([]);

0 commit comments

Comments
 (0)