Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
31 | public function __invoke( |
||
32 | RequestInterface $request, |
||
33 | ResponseInterface $response, |
||
34 | callable $next = null |
||
35 | ) { |
||
36 | parent::__invoke($request, $response, $next); |
||
37 | |||
38 | if ($this->payload !== null) { |
||
39 | $request = $request->withBody( |
||
40 | StreamFactory::create( |
||
41 | json_encode($this->payload) |
||
42 | ) |
||
43 | ); |
||
44 | } |
||
45 | |||
46 | return $next($request, $response); |
||
47 | } |
||
48 | } |
||
49 |