Completed
Push — master ( 29547f...5e0db9 )
by Matthew
02:17
created

Agent::current()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Matt
5
 * Date: 20/04/2016
6
 * Time: 2:32 PM
7
 */
8
9
namespace Freshdesk\Resources;
10
11
use Freshdesk\Resources\Traits\AllTrait;
12
use Freshdesk\Resources\Traits\CreateTrait;
13
use Freshdesk\Resources\Traits\ViewTrait;
14
15
/**
16
 * Agent resources
17
 *
18
 * @package Freshdesk\Resources
19
 */
20 View Code Duplication
class Agent extends AbstractResource
0 ignored issues
show
Duplication introduced by
This class 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
23
    use AllTrait, CreateTrait, ViewTrait;
24
25
    /**
26
     * The resource endpoint
27
     *
28
     * @var string
29
     */
30
    protected $endpoint = '/agents';
31
32
    /**
33
     *
34
     * Get the currently authenticated agent
35
     *
36
     * @param array|null $query
37
     * @return array|null
38
     * @throws \Freshdesk\Exceptions\AccessDeniedException
39
     * @throws \Freshdesk\Exceptions\ApiException
40
     * @throws \Freshdesk\Exceptions\AuthenticationException
41
     * @throws \Freshdesk\Exceptions\ConflictingStateException
42
     * @throws \Freshdesk\Exceptions\NotFoundException
43
     * @throws \Freshdesk\Exceptions\RateLimitExceededException
44
     * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException
45
     * @throws \Freshdesk\Exceptions\MethodNotAllowedException
46
     * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException
47
     * @throws \Freshdesk\Exceptions\ValidationException
48
     */
49
    public function current(array $query = null)
50
    {
51
        return $this->api->request('GET', $this->endpoint('me'), null, $query);
52
    }
53
54
}