VersionableRequestMaker   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
getRequest() 0 1 ?
A setVersion() 0 6 1
A getVersion() 0 4 1
1
<?php
2
3
namespace Cerbero\FluentApi;
4
5
use BadMethodCallException;
6
use Cerbero\FluentApi\Inflectors\Psr4ResourceInflector;
7
use Cerbero\FluentApi\Inflectors\ResourceInflectorInterface;
8
9
/**
10
 * Abstract implementation of a versionable request maker.
11
 *
12
 * @author    Andrea Marco Sartori
13
 */
14
abstract class VersionableRequestMaker
15
{
16
    /**
17
     * The HTTP call request.
18
     *
19
     * @var Cerbero\FluentApi\Requests\Request
20
     */
21
    protected $request;
22
23
    /**
24
     * The version number of the API.
25
     *
26
     * @author  Andrea Marco Sartori
27
     * @var     string|null
28
     */
29
    protected $version;
30
31
    /**
32
     * Retrieve the request to pass through resources.
33
     *
34
     * @return    Cerbero\FluentApi\Requests\Request
35
     */
36
    abstract public function getRequest();
37
38
    /**
39
     * Set the version number.
40
     *
41
     * @author    Andrea Marco Sartori
42
     * @param    string|null    $version
43
     * @return    $this
44
     */
45
    public function setVersion($version)
46
    {
47
        $this->version = $version;
48
49
        return $this;
50
    }
51
52
    /**
53
     * Retrieve the version number.
54
     *
55
     * @author    Andrea Marco Sartori
56
     * @return    string
57
     */
58
    public function getVersion()
59
    {
60
        return $this->version;
61
    }
62
}
63