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

AuthorizationCodeFlow   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleAuthorizationRequest() 0 10 1
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
}