Completed
Push — master ( 2a8373...bfc208 )
by Andreas
03:38
created

Delete::getResourceUri()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 12
rs 9.4285
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
3
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5
namespace Everypay\Action;
6
7
use Everypay\Http\Client\ClientInterface;
8
9
class Delete extends AbstractAction
10
{
11
    protected $method = ClientInterface::METHOD_DELETE;
12
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function __invoke()
17
    {
18
        return $this->createRequest($this->method);
19
    }
20
21
    protected function getResourceUri()
22
    {
23
        $uri = parent::getResourceUri();
24
25
        if (isset($this->params['card'])) {
26
            return $uri
27
                . '/card/'
28
                . $this->params['card'];
29
        }
30
31
        return $uri;
32
    }
33
}
34