Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | private function insertIntoPostForms(ResponseInterface $response, callable $replace) |
||
39 | { |
||
40 | $html = (string) $response->getBody(); |
||
41 | $html = preg_replace_callback('/(<form\s[^>]*method=["\']?POST["\']?[^>]*>)/i', $replace, $html, -1, $count); |
||
42 | |||
43 | if (!empty($count)) { |
||
44 | $body = self::createStream(); |
||
45 | $body->write($html); |
||
46 | |||
47 | return $response->withBody($body); |
||
48 | } |
||
49 | |||
50 | return $response; |
||
51 | } |
||
52 | } |
||
53 |