stevenmaguire / oauth2-microsoft

Microsoft OAuth 2.0 support for the PHP League's OAuth 2.0 Client
MIT License
68 stars 41 forks source link

PHP 7 warning of Illegal string offset #4

Closed rbairwell closed 9 years ago

rbairwell commented 9 years ago

Under PHP7, the warning:

<b>Warning</b>:  Illegal string offset 'message' in <b>/.../vendor/stevenmaguire/oauth2-microsoft/src/Provider/Microsoft.php</b> on line <b>58</b><br />

is generated.

Changing (in protected function checkResponse(ResponseInterface $response, $data) )

 $data['error']['message'] ?: $response->getReasonPhrase(),

to:

 (isset($data['error']['message']) ? $data['error']['message'] : $response->getReasonPhrase()),

fixes this warning.

stevenmaguire commented 9 years ago

Great, thank you for catching that. I've made a code change and cut a new release tag. Version 0.2.1 is available now.