| 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 | 34 | public function __construct($method, array $data = []) { |
|
| 31 | 34 | if (!is_string($method)) { |
|
| 32 | throw new \InvalidArgumentException('Parameter "method" should be a string, ' . gettype($method) . ' given.'); |
||
| 33 | } |
||
| 34 | 34 | $method = strtoupper($method); |
|
| 35 | 34 | if (!in_array($method, [self::METHOD_GET, self::METHOD_POST])) { |
|
| 36 | 1 | throw new \InvalidArgumentException('Invalid http method name.'); |
|
| 37 | } |
||
| 38 | 33 | $this->method = $method; |
|
| 39 | 33 | $this->data = $data; |
|
| 40 | 33 | } |
|
| 41 | |||
| 85 | } |