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

Endpoint   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 6 1
A find() 0 6 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
    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