private function insertIntoPostForms(ResponseInterface $response, callable $replace)
    {
        $html = (string) $response->getBody();
        $html = preg_replace_callback('/(<form\s[^>]*method=["\']?POST["\']?[^>]*>)/i', $replace, $html, -1, $count);

        if (!empty($count)) {
            $body = self::createStream();
            $body->write($html);

            return $response->withBody($body);
        }

        return $response;
    }
private function insertIntoPostForms(ResponseInterface $response, callable $replace)
    {
        $html = (string) $response->getBody();
        $html = preg_replace_callback('/(<form\s[^>]*method=["\']?POST["\']?[^>]*>)/i', $replace, $html, -1, $count);

        if (!empty($count)) {
            $body = self::createStream();
            $body->write($html);

            return $response->withBody($body);
        }

        return $response;
    }
private function insertIntoPostForms ( ResponseInterface $ response , callable $ replace ) { $ html = ( string ) $ response -> getBody ( ) ; $ html = preg_replace_callback ( '/(<form\s[^>]*method=["\']?POST["\']?[^>]*>)/i' , $ replace , $ html , - 1 , $ count ) ; if ( ! empty ( $ count ) ) { $ body = self :: createStream ( ) ; $ body -> write ( $ html ) ; return $ response -> withBody ( $ body ) ; } return $ response ; }
Insert content into all POST forms.

@param ResponseInterface $response
@param callable          $replace

@return ResponseInterface
Insert content into all POST forms .