GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 3b033a...7f82f7 )
by Dragos
14:20
created

Manager::getManager()   A

Complexity

Conditions 2
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 10
loc 10
rs 9.4285
cc 2
eloc 6
nc 3
nop 1
1
<?php
2
3
namespace Speicher210\KontaktIO\Resource;
4
5
use GuzzleHttp\Exception\ClientException;
6
use Speicher210\KontaktIO\AbstractResource;
7
use Speicher210\KontaktIO\Model\Manager as ManagerModel;
8
9
/**
10
 * Manager resource.
11
 */
12
class Manager extends AbstractResource
13
{
14
    /**
15
     * Get a manager.
16
     *
17
     * @param string $id The manager UUID.
18
     * @return ManagerModel
19
     */
20 View Code Duplication
    public function getManager($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        try {
23
            $response = $this->client->get('/manager/'.$id);
24
25
            return $this->serializer->deserialize($response->getBody(), ManagerModel::class, 'json');
26
        } catch (ClientException $e) {
27
            throw $this->createApiException($e);
28
        }
29
    }
30
31
    /**
32
     * Get the manager for the user owing the API key.
33
     *
34
     * @return ManagerModel
35
     */
36
    public function getMyManager()
37
    {
38
        return $this->getManager('me');
39
    }
40
}
41