klapaudius / FOSOAuthServerBundle

A server side OAuth2 Bundle for Symfony 5.0 or higher
7 stars 22 forks source link

Fix OAuthStorage::checkGrantExtension return strict type #17

Closed JokubasR closed 1 year ago

JokubasR commented 1 year ago

\OAuth2\IOAuth2GrantExtension::checkGrantExtension has bool|array return type:

/**
....
     *
     * @return bool|array Returns false if the authorization is rejected or not support. Returns true or an associative array if you
     * want to verify the scope:
     * @code
     * return array(
     * 'scope' => <stored scope values (space-separated string)>,
     * );
     * @endcode
     *
     * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-1.4.5
     * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.2
     */

This PR fixes return strict type and adds a unit test to ensure its stability in the future.