| Conditions | 4 | 
| Paths | 3 | 
| Total Lines | 22 | 
| Code Lines | 11 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 46 | public function addMethods(...$methods) | ||
| 47 |     { | ||
| 48 | // uppercase and exclude empties | ||
| 49 | $methods = array_reduce( | ||
| 50 | $methods, | ||
| 51 |             static function &(&$result, $method) { | ||
| 52 | $method = strtoupper(trim($method)); | ||
| 53 |                 if (strlen($method)) { | ||
| 54 | $result[] = $method; | ||
| 55 | } | ||
| 56 | return $result; | ||
| 57 | }, | ||
| 58 | [] | ||
| 59 | ); | ||
| 60 | |||
| 61 |         foreach ($methods as $method) { | ||
| 62 |             if (!in_array($method, $this->methods, true)) { | ||
| 63 | $this->methods[] = $method; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | |||
| 67 | return $this; | ||
| 68 | } | ||
| 82 |