Completed
Push — master ( aff56e...1ae453 )
by Beñat
03:31
created

ElectedModerators::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
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\User;
15
16
use BenatEspina\StackExchangeApiClient\Api\UserApi;
17
use BenatEspina\StackExchangeApiClient\Http\HttpClient;
18
use BenatEspina\StackExchangeApiClient\Serializer\Serializer;
19
20
/**
21
 * https://api.stackexchange.com/docs/elected-moderators.
22
 *
23
 * @author Beñat Espiña <[email protected]>
24
 */
25
class ElectedModerators
26
{
27
    private const URL = '/users/moderators/elected';
28
29
    private $client;
30
    private $serializer;
31
32
    public function __construct(HttpClient $client, Serializer $serializer)
33
    {
34
        $this->client = $client;
35
        $this->serializer = $serializer;
36
    }
37
38
    public function __invoke(array $parameters = UserApi::QUERY_PARAMS)
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...
39
    {
40
        return $this->serializer->serialize(
41
            $this->client->get(
42
                self::URL,
43
                $parameters
44
            )
45
        );
46
    }
47
}
48