Passed
Push — master ( 2cd332...0af4da )
by Ross
02:35
created

Request   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 8
dl 0
loc 88
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getHeaders() 0 3 1
A setUrl() 0 3 1
A setHeaders() 0 3 1
A getFields() 0 3 1
A getUrl() 0 3 1
A setRequestType() 0 3 1
A getRequestType() 0 3 1
A setFields() 0 3 1
1
<?php
2
/**
3
 *
4
 * Copyright (C) 2018  Ross Mitchell
5
 *
6
 * This file is part of RossMitchell/UpdateCloudFlare.
7
 *
8
 * RossMitchell/UpdateCloudFlare is free software: you can redistribute
9
 * it and/or modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
namespace RossMitchell\UpdateCloudFlare\Tests\Fakes;
23
24
25
use RossMitchell\UpdateCloudFlare\Interfaces\RequestInterface;
26
27
class Request implements RequestInterface
28
{
29
    /**
30
     * @var array
31
     */
32
    private $headers = [];
33
    /**
34
     * @var string
35
     */
36
    private $requestType;
37
    /**
38
     * @var array
39
     */
40
    private $fields = [];
41
    /**
42
     * @var string
43
     */
44
    private $url;
45
    /**
46
     * If headers need to be sent through then they can be returned with this method. If not return an empty array
47
     *
48
     * @return array
49
     */
50
    public function getHeaders(): array
51
    {
52
        return $this->headers;
53
    }
54
55
    /**
56
     * They type of request that is going to be made
57
     *
58
     * @return string
59
     */
60
    public function getRequestType(): string
61
    {
62
        return $this->requestType;
63
    }
64
65
    /**
66
     * If the request needs data to be sent though return it here. If not return an empty array
67
     *
68
     * @return array
69
     */
70
    public function getFields(): array
71
    {
72
        return $this->fields;
73
    }
74
75
    /**
76
     * Return the URL that the request should be made to
77
     *
78
     * @return string
79
     */
80
    public function getUrl(): string
81
    {
82
        return $this->url;
83
    }
84
85
    /**
86
     * @param array $headers
87
     */
88
    public function setHeaders(array $headers)
89
    {
90
        $this->headers = $headers;
91
    }
92
93
    /**
94
     * @param string $requestType
95
     */
96
    public function setRequestType(string $requestType)
97
    {
98
        $this->requestType = $requestType;
99
    }
100
101
    /**
102
     * @param array $fields
103
     */
104
    public function setFields(array $fields)
105
    {
106
        $this->fields = $fields;
107
    }
108
109
    /**
110
     * @param string $url
111
     */
112
    public function setUrl(string $url)
113
    {
114
        $this->url = $url;
115
    }
116
}
117