Completed
Pull Request — master (#52)
by Loick
09:41 queued 17s
created

Operation::getScheme()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Joli\Jane\OpenApi\Operation;
4
5
use Joli\Jane\OpenApi\Model\Operation as OpenApiOperation;
6
7
class Operation
8
{
9
    const DELETE  = 'DELETE';
10
    const GET     = 'GET';
11
    const POST    = 'POST';
12
    const PUT     = 'PUT';
13
    const PATCH   = 'PATCH';
14
    const OPTIONS = 'OPTIONS';
15
    const HEAD    = 'HEAD';
16
17
    /**
18
     * @var \Joli\Jane\OpenApi\Model\Operation
19
     */
20
    private $operation;
21
22
    /**
23
     * @var string
24
     */
25
    private $path;
26
27
    /**
28
     * @var string
29
     */
30
    private $method;
31
32 8
    /**
33
     * @var string
34 8
     */
35 8
    private $host;
36 8
37 8
    /**
38 8
     * @var string
39
     */
40
    private $scheme;
41
42
    public function __construct(OpenApiOperation $operation, $path, $method, $basePath = "", $host = 'localhost', $scheme = 'http')
43 8
    {
44
        $this->operation = $operation;
45 8
        $this->path      = $basePath . $path;
46
        $this->method    = $method;
47
        $this->host      = $host;
48
        $this->scheme    = $scheme;
49
    }
50
51 8
    /**
52
     * @return string
53 8
     */
54
    public function getMethod()
55
    {
56
        return $this->method;
57
    }
58
59 8
    /**
60
     * @return \Joli\Jane\OpenApi\Model\Operation
61 8
     */
62
    public function getOperation()
63
    {
64
        return $this->operation;
65
    }
66
67 8
    /**
68
     * @return string
69 8
     */
70
    public function getPath()
71
    {
72
        return $this->path;
73
    }
74
75
    /**
76
     * @return string
77
     */
78
    public function getHost()
79
    {
80
        return $this->host;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getScheme()
87
    {
88
        return $this->scheme;
89
    }
90
}
91