Request   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Importance

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