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 php 8.4 deprecated types #688

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

incoming-th
Copy link
Contributor

Fix the PHP 8.4 warning messages:

PHP Deprecated: Laratrust\Traits\HasRolesAndPermissions::allPermissions(): Implicitly marking parameter $columns as nullable is deprecated, the explicit nullable type must be used instead in /vendor/santigarcor/laratrust/src/Traits/HasRolesAndPermissions.php on line 501

PHP Deprecated: Laratrust\Contracts\LaratrustUser::allPermissions(): Implicitly marking parameter $columns as nullable is deprecated, the explicit nullable type must be used instead in /vendor/santigarcor/laratrust/src/Contracts/LaratrustUser.php on line 153

@incoming-th
Copy link
Contributor Author

@santigarcor Let me know if something else need to be provided for the PR.

@@ -150,5 +150,5 @@ public function syncPermissions(
*
* @return Collection<\Laratrust\Contracts\Permission>
*/
public function allPermissions(array $columns = null, $team = false): Collection;
public function allPermissions(?array $columns = null, bool $team = false): Collection;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$team should be a mixed variable.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -498,7 +498,7 @@ public function syncPermissionsWithoutDetaching(
*
* @return Collection<\Laratrust\Contracts\Permission>
*/
public function allPermissions(array $columns = null, $team = false): Collection
public function allPermissions(?array $columns = null, bool $team = false): Collection
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$team should be a mixed variable.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@santigarcor
Copy link
Owner

@incoming-th can you please add 8.4 to this php versions array https://github.com/santigarcor/laratrust/blob/master/.github/workflows/tests.yml#L14

@incoming-th
Copy link
Contributor Author

@incoming-th can you please add 8.4 to this php versions array https://github.com/santigarcor/laratrust/blob/master/.github/workflows/tests.yml#L14

@santigarcor Sure, I totally forgot about this thanks.

@santigarcor santigarcor merged commit a35abe7 into santigarcor:master Jan 16, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants