Description
Hi I was trying to get the identify of third party, but I can see the most of the others dependencies like oauth2-client, linkedin and so on, use the getId()
with the id
provider by the api, it's kind make sense :), But I would like to getEmail
too
then my suggestion is create a new Interface like
interface ResourceOwnerEmailInterface extends ResourceOwnerInterface
{
public function getEmail(): string;
}
and for the api that has email implements email, uses ResourceOwnerEmailInterface
instead of ResourceOwnerInterface
the second option is
interface ResourceOwnerEmailInterface
{
public function getEmail(): string;
}
and the Owner class implements both interface ResourceOwnerEmailInterface
and ResourceOwnerInterface
, But I'm not sure about this, it can be useful or not! but the positive thing about this is, we can create others interface like
Email
, firstName
, Lastname
and image
, the for the api that has those information just need to add those interfaces.
it will be like this
class ApiBlaBlaOwner implements ResourceOwnerEmailInterface, ResourceOwnerNameInterface, ResourceOwnerImageInterface, ResourceOwnerInterface
Because those fields are quite useful for most of applications