| Conditions | 2 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public static function createFromIlluminateRequest(IlluminateRequest $illuminateRequest): Request |
||
| 37 | { |
||
| 38 | return collect([ |
||
| 39 | 'token', |
||
| 40 | 'teamId', |
||
| 41 | 'teamDomain', |
||
| 42 | 'channelId', |
||
| 43 | 'channelName', |
||
| 44 | 'userId', |
||
| 45 | 'userName', |
||
| 46 | 'command', |
||
| 47 | 'text', |
||
| 48 | 'responseUrl', |
||
| 49 | ])->reduce(function (Request $request, string $propertyName) use ($illuminateRequest) { |
||
| 50 | |||
| 51 | |||
| 52 | $request->$propertyName = $illuminateRequest->get(snake_case($propertyName)); |
||
| 53 | |||
| 54 | if ($propertyName == 'command') { |
||
| 55 | |||
| 56 | //remove slash |
||
| 57 | $request->command = substr($request->command, 1); |
||
| 58 | } |
||
| 59 | return $request; |
||
| 60 | }, new static()); |
||
| 61 | } |
||
| 62 | |||
| 73 |