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::getMyManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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