Completed
Push — master ( f5580e...4e6c29 )
by Beñat
01:39
created

AccessTokenApi   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 26
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A applicationDeAuthenticate() 0 4 1
A invalidate() 0 4 1
A read() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Stack Exchange Api Client library.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace BenatEspina\StackExchangeApiClient\Api;
15
16
use BenatEspina\StackExchangeApiClient\Api\AccessToken\ApplicationDeAuthenticate;
17
use BenatEspina\StackExchangeApiClient\Api\AccessToken\Invalidate;
18
use BenatEspina\StackExchangeApiClient\Api\AccessToken\Read;
19
use BenatEspina\StackExchangeApiClient\Http\HttpClient;
20
use BenatEspina\StackExchangeApiClient\Serializer\Serializer;
21
22
/**
23
 * @author Beñat Espiña <[email protected]>
24
 */
25
class AccessTokenApi
26
{
27
    private $client;
28
    private $serializer;
29
30
    public function __construct(HttpClient $client, Serializer $serializer)
31
    {
32
        $this->client = $client;
33
        $this->serializer = $serializer;
34
    }
35
36
    public function applicationDeAuthenticate($accessTokens, array $parameters = [])
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
37
    {
38
        return (new ApplicationDeAuthenticate($this->client, $this->serializer))->__invoke($accessTokens, $parameters);
39
    }
40
41
    public function invalidate($accessTokens, array $parameters = [])
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
42
    {
43
        return (new Invalidate($this->client, $this->serializer))->__invoke($accessTokens, $parameters);
44
    }
45
46
    public function read($accessTokens, array $parameters = [])
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
47
    {
48
        return (new Read($this->client, $this->serializer))->__invoke($accessTokens, $parameters);
49
    }
50
}
51