VersionableRequestMaker::getRequest()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 1
c 1
b 0
f 0
nc 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