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