thephpleague / oauth2-server

A spec compliant, secure by default PHP OAuth 2.0 Server
https://oauth2.thephpleague.com
MIT License
6.49k stars 1.12k forks source link

Compatibility on interfaces #1413

Open JoMo1970 opened 3 weeks ago

JoMo1970 commented 3 weeks ago

Hello,

I am trying to use this framework but I am consistently hitting the below issue:

Fatal error: Declaration of OAuth2ServerExamples\Repositories\ClientRepository::getClientEntity(string $clientIdentifier): ?League\OAuth2\Server\Entities\ClientEntityInterface must be compatible with League\OAuth2\Server\Repositories\ClientRepositoryInterface::getClientEntity($clientIdentifier)

I cannot seem to get passed this problem. It happens when the AuthorizationServer object initializes and I try the /authorize flow. I might have a configuration wrong but I am not sure. Anybody have any ideas? Thanks in advance.

eugene-borovov commented 3 weeks ago

Hello, @JoMo1970.

This is a PHP issue. Make your implementation fully compatible with an interface. I suggest to set up type hints in method declaration.

JoMo1970 commented 3 weeks ago

Understood. Appreciate the feedback.