Endpoint::find()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
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 8
    public function all($limit = 1, $offset = 0)
17
    {
18 8
        return $this->respond(
19 8
            $this->client->get($this->getEndpointUrl(null, false), ['limit' => $limit, 'offset' => $offset])
20 8
        );
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 9
    public function find($identifier)
29
    {
30 9
        return $this->respond(
31 9
            $this->client->get($this->getEndpointUrl($identifier, true))
32 9
        );
33
    }
34
}
35