1 | <?php |
||
16 | class Spike implements SpikeInterface |
||
17 | { |
||
18 | /** |
||
19 | * The action. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $action; |
||
24 | |||
25 | /** |
||
26 | * Array of custom headers. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $headers = []; |
||
31 | |||
32 | /** |
||
33 | * @var mixed |
||
34 | */ |
||
35 | protected $body; |
||
36 | |||
37 | /** |
||
38 | * The global headers. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected static $globalHeaders = []; |
||
43 | |||
44 | /** |
||
45 | * Spike constructor. |
||
46 | * |
||
47 | * @param string $action |
||
48 | * @param mixed $body |
||
49 | * @param array $headers |
||
50 | */ |
||
51 | public function __construct($action, $body = null, $headers = []) |
||
57 | |||
58 | public function __toString() |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function setAction($action) |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function getAction() |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function setHeaders(array $headers) |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | public function getHeaders() |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public function setHeader($name, $value) |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function getHeader($name) |
||
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | public function toString() |
||
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | public function setBody($body) |
||
132 | |||
133 | /** |
||
134 | * {@inheritdoc} |
||
135 | */ |
||
136 | public function getBody() |
||
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | public static function fromString($string) |
||
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | public static function fromArray($array) |
||
165 | |||
166 | /** |
||
167 | * Sets a global header. |
||
168 | * |
||
169 | * @param string $name |
||
170 | * @param string $value |
||
171 | */ |
||
172 | public static function setGlobalHeader($name, $value) |
||
176 | } |
This check looks for calls to
isset(...)
orempty()
on variables that are yet undefined. These calls will always produce the same result and can be removed.This is most likely caused by the renaming of a variable or the removal of a function/method parameter.