Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 0 |
1 | <?php |
||
30 | 35 | public function __construct($method, array $data = []) { |
|
31 | 35 | if (!is_string($method)) { |
|
32 | throw new \InvalidArgumentException('Parameter "method" should be a string, ' . gettype($method) . ' given.'); |
||
33 | } |
||
34 | 35 | $method = strtoupper($method); |
|
35 | 35 | if (!in_array($method, [self::METHOD_GET, self::METHOD_POST])) { |
|
36 | 1 | throw new \InvalidArgumentException('Invalid http method name.'); |
|
37 | } |
||
38 | 34 | $this->method = $method; |
|
39 | 34 | $this->data = $data; |
|
40 | 34 | } |
|
41 | |||
85 | } |