Conditions | 4 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
33 | public function inbound($request, Context $ctx) |
||
34 | { |
||
35 | /** |
||
36 | * @var Request $request |
||
37 | */ |
||
38 | |||
39 | $attachments = []; |
||
40 | |||
41 | foreach ($this->keys as $key) { |
||
42 | $ctx->has($key) && $attachments[$key] = $ctx->get($key); |
||
43 | } |
||
44 | |||
45 | if ($attachments) { |
||
46 | $dat = base64_encode(json_encode($attachments, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); |
||
47 | $request->opsExtra('h-headers', static function (&$headers) use ($dat) { |
||
48 | $headers[self::HTTP_HEADER] = $dat; |
||
49 | }); |
||
50 | } |
||
51 | |||
52 | return $request; |
||
53 | } |
||
65 |