Retrieve   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 5
c 3
b 1
f 0
lcom 1
cbo 1
dl 0
loc 37
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getMethod() 0 4 1
A getPath() 0 4 1
A getData() 0 4 1
1
<?php
2
3
namespace Pin\Charge;
4
5
use Pin\RequestInterface;
6
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
7
8
class Retrieve implements RequestInterface
9
{
10
    protected $token;
11
12
    public function __construct($token)
13
    {
14
        if (!is_string($token)) {
15
            throw new InvalidOptionsException('The first argument is expected to be of type "string"');
16
        }
17
18
        $this->token = $token;
19
    }
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function getMethod()
25
    {
26
        return self::METHOD_GET;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function getPath()
33
    {
34
        return sprintf('/1/charges/%s', $this->token);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getData()
41
    {
42
        return array();
43
    }
44
}
45