Builder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Authorization Builder Class
6
 * @category    Ticaje
7
 * @author      Max Demian <[email protected]>
8
 */
9
10
namespace Ticaje\AeSdk\Infrastructure\Provider\Authorization;
11
12
use Ticaje\AeSdk\Infrastructure\Interfaces\Provider\Auth\AuthBuilderInterface;
13
14
/**
15
 * Class Builder
16
 * @package Ticaje\AeSdk\Infrastructure\Provider\Authorization
17
 */
18
class Builder implements AuthBuilderInterface
19
{
20
    private $responseType = 'code';
21
22
    private $state = '1212';
23
24
    private $view = 'web';
25
26
    private $sp = 'ae';
27
28
    /**
29
     * @param array $params
30
     * @return string
31
     * This method implements bounded business logic on infrastructure side
32
     */
33
    public function build(array $params): string
34
    {
35
        $clientId = $params['client_id'];
36
        $callback = $params['callback'];
37
        $result = "response_type={$this->responseType}&client_id={$clientId}&redirect_uri={$callback}&state={$this->state}&view={$this->view}&sp={$this->sp}";
38
        return $result;
39
    }
40
}
41