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

AllTrait::endpoint()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
nc 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Matthew
5
 * Date: 21/04/2016
6
 * Time: 9:10 AM
7
 */
8
9
namespace Freshdesk\Resources\Traits;
10
11
trait AllTrait
12
{
13
14
    /**
15
     * @param null $end string
16
     * @return string
17
     */
18
    abstract public function endpoint($end = null);
19
20
    /**
21
     * Get a list of all agents for the given query parameters eg $query = ['page' => 2]
22
     *
23
     * @param array|null $query
24
     * @throws \Freshdesk\Exceptions\AccessDeniedException
25
     * @throws \Freshdesk\Exceptions\ApiException
26
     * @throws \Freshdesk\Exceptions\AuthenticationException
27
     * @throws \Freshdesk\Exceptions\ConflictingStateException
28
     * @throws \Freshdesk\Exceptions\NotFoundException
29
     * @throws \Freshdesk\Exceptions\RateLimitExceededException
30
     * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException
31
     * @throws \Freshdesk\Exceptions\MethodNotAllowedException
32
     * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException
33
     * @throws \Freshdesk\Exceptions\ValidationException
34
     */
35
    public function all(array $query = null)
36
    {
37
        $this->api->request('GET', $this->endpoint(), null, $query);
0 ignored issues
show
Bug introduced by
The property api does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
38
    }
39
40
}