Open leereichardt opened 4 years ago
Yeah–from what I can see it should be the interface...
That change will need to be made be over here
Cool. I'll try to do a PR over there too.
@leereichardt Did you get around to getting this change into a PR? getTenants
fails for me using the example code for the reasons you mentioned above.
@calcinai Another quick point relating to this.
AccessTokenInterface
was added to league/oauth-client in v2.4.0 which requires PHP5.6 which breaks the php55 support of this package. Am I missing a work around here or is the php55 compatability not active anymore?
Cheers
@ljenningsVS Great question. I think we're going to have to drop 5.5, it was there (selfishly) for a legacy GAE project.
@calcinai No worries i have a work around for now by crafting the genTenant call manually like
private function getTenantIds($provider, $token)
{
$request = $provider->getAuthenticatedRequest(
'GET',
$provider->getTenantsUrl(),
$token
);
$response = $provider->getResponse($request);
$tenants = [];
foreach ($response as $tenantData) {
$tenants[] = XeroTenant::fromArray($tenantData);
}
return $tenants;
}
This is a valid work around for me for the moment anyway. Do you forsee any other issues if I lock my version of this pacakge to the current tag?
Whoops. May have forgotten about this 😅 PR here: https://github.com/calcinai/oauth2-xero/pull/8
Both getTenants and getResourceOwner require to us pass-through the token interface. We can pass through the same token object to both, however, getResourceOwner complains it's expecting
\League\OAuth2\Client\Token\AccessToken
rather than the\League\OAuth2\Client\Token\AccessTokenInterface
provided.This is mainly in the IDE hinting so more a type casting and DocBlock update. Let me know if what I'm saying is right and I do a PR for you if you'd like