Completed
Push — master ( 8915a7...701bcc )
by Pascal
04:30
created

Pokemon   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
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 30
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\Endpoints;
3
4
use Atog\Api\Endpoint;
5
6
/**
7
 * Class Pokemon
8
 * @package Atog\PHPokemon\Endpoints
9
 */
10
class Pokemon extends Endpoint
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $endpoint = 'pokemon';
16
17
    /**
18
     * @param int $limit
19
     * @param int $offset
20
     * @return \Atog\Api\Model|null
21
     */
22
    public function all($limit = 1, $offset = 0)
23
    {
24
        return $this->respond(
25
            $this->client->get($this->getEndpointUrl(null, false), ['limit' => $limit, 'offset' => $offset])
26
        );
27
    }
28
29
    /**
30
     * @param string|int $identifier id or name of the pokemon
31
     * @return \Atog\Api\Model|null
32
     */
33
    public function find($identifier)
34
    {
35
        return $this->respond(
36
            $this->client->get($this->getEndpointUrl(strtolower($identifier), true))
37
        );
38
    }
39
}
40