Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function __construct(array $methods) |
||
20 | { |
||
21 | $methods = array_map('strtoupper', $methods); |
||
22 | |||
23 | foreach ($methods as $method) { |
||
24 | if (!in_array($method, self::ALLOWED_METHODS)) { |
||
25 | throw new InvalidArgumentException('Method "' . $method . '" is not valid, only the following methods are allowed: ' . join(', ', self::ALLOWED_METHODS)); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | $this->methods = $methods; |
||
30 | } |
||
31 | |||
39 | } |