Completed
Push — master ( 978567...468b8f )
by Pascal
16:13
created

Endpoint::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
namespace Atog\PHPokemon;
3
4
/**
5
 * Class Endpoint
6
 * @package Atog\PHPokemon
7
 */
8
class Endpoint extends \Atog\Api\Endpoint
9
{
10
    /**
11
     * Get all entries paginated
12
     * @param int $limit
13
     * @param int $offset
14
     * @return \Atog\Api\Model|null
15
     */
16
    public function all($limit = 1, $offset = 0)
17
    {
18
        return $this->respond(
19
            $this->client->get($this->getEndpointUrl(null, false), ['limit' => $limit, 'offset' => $offset])
20
        );
21
    }
22
23
    /**
24
     * Get an entry by an identifier
25
     * @param mixed $identifier id of the type
26
     * @return \Atog\Api\Model|null
27
     */
28
    public function find($identifier)
29
    {
30
        return $this->respond(
31
            $this->client->get($this->getEndpointUrl($identifier, true))
32
        );
33
    }
34
}
35