Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
25 | public function markup($message) |
||
26 | { |
||
27 | @trigger_error('"httplug_markup" twig extension is deprecated since version 1.17 and will be removed in 2.0. Use "@Httplug/http_message.html.twig" template instead.', E_USER_DEPRECATED); |
||
28 | |||
29 | $safeMessage = htmlentities($message); |
||
30 | $parts = preg_split('|\\r?\\n\\r?\\n|', $safeMessage, 2); |
||
31 | |||
32 | if (!isset($parts[1])) { |
||
33 | // This is not a HTTP message |
||
34 | return $safeMessage; |
||
35 | } |
||
36 | |||
37 | if (empty($parts[1])) { |
||
38 | $parts[1] = '(This message has no captured body)'; |
||
39 | } |
||
40 | |||
41 | // make header names bold |
||
42 | $headers = preg_replace("|\n(.*?): |si", "\n<b>$1</b>: ", $parts[0]); |
||
43 | |||
44 | return sprintf("%s\n\n<div class='httplug-http-body httplug-hidden'>%s</div>", $headers, $parts[1]); |
||
45 | } |
||
46 | |||
52 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.