Passed
Push — master ( 411f65...7cec5a )
by Alexandre
02:03
created

handleAuthorizationRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 2
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 07/03/2018
6
 * Time: 23:43
7
 */
8
9
namespace OAuth2\Extensions\PKCE\Flows;
10
11
12
use OAuth2\Endpoints\AuthorizationEndpoint;
13
14
/**
15
 * Class AuthorizationCodeFlow
16
 * @package OAuth2\Extensions\PKCE\Flows
17
 * @rfc https://tools.ietf.org/html/rfc7636
18
 */
19
class AuthorizationCodeFlow extends \OAuth2\Flows\AuthorizationCodeFlow
20
{
21
    function handleAuthorizationRequest(AuthorizationEndpoint $authorizationEndpoint, array $requestData): array
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
22
    {
23
        $authorizationCode = $this->authorizationCodeStorage->generate(
24
            implode(' ', $authorizationEndpoint->getScopes()),
25
            $authorizationEndpoint->getClient()->getIdentifier(),
26
            $authorizationEndpoint->getResourceOwner()->getIdentifier(),
27
            $requestData['scope'] ?? null,
28
            $requestData['redirect_uri'] ?? null
29
        );
30
        return ['code' => $authorizationCode->getCode()];
31
    }
32
}