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

Cartalyst\Sentinel\Users\EloquentUser::getPermissions(): Return value must be of type array, string returned #577

Open
jamieisps opened this issue May 9, 2024 · 0 comments

Comments

@jamieisps
Copy link

jamieisps commented May 9, 2024

Your Environment

  • PHP Version: 8.3
  • Sentinel Version: ^6.0

Expected behaviour

Persmissions to be returned

Actual behaviour

Error is Cartalyst\Sentinel\Users\EloquentUser::getPermissions(): Return value must be of type array, string returned

Changing /Users/jamiegill/Repositories/lifestyle-fitness/vendor/cartalyst/sentinel/src/Permissions/PermissibleTrait.php

public function getPermissions(): array
{
return $this->permissions ?? [];
}

To

public function getPermissions(): array
{
return $this->permissions !== null && $this->permissions !== '' ? $this->permissions : [];
}

Seems to resolve this, unsure why a string is returned after the upgrade but thought this may help others.

NOTE - I do not in no way recommend editing vendor packages unfortunately I was in a position I had to do this to get the build working correctly.

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

No branches or pull requests

1 participant