1 | <?php |
||
40 | class BrowserHandler extends HandlerAbstract |
||
41 | { |
||
42 | /** |
||
43 | * cached messages |
||
44 | * |
||
45 | * @static |
||
46 | * @var string[] |
||
47 | * @access protected |
||
48 | */ |
||
49 | protected static $messages = []; |
||
50 | |||
51 | /** |
||
52 | * {@inheritDoc} |
||
53 | */ |
||
54 | public function __construct( |
||
69 | |||
70 | /** |
||
71 | * {@inheritDoc} |
||
72 | */ |
||
73 | protected function write(LogEntryInterface $logEntry) |
||
77 | |||
78 | /** |
||
79 | * Only use this handler in browser mode |
||
80 | * |
||
81 | * {@inheritDoc} |
||
82 | */ |
||
83 | protected function isHandlingOther(LogEntryInterface $logEntry)/*# : bool */ |
||
87 | |||
88 | /** |
||
89 | * flush the messages to browser by adding to HTML page |
||
90 | * |
||
91 | * @return void |
||
92 | * @access public |
||
93 | * @static |
||
94 | * @api |
||
95 | */ |
||
96 | public static function flush() |
||
103 | |||
104 | /** |
||
105 | * Overrided |
||
106 | * |
||
107 | * Format your message like |
||
108 | * |
||
109 | * [[text goes here]]{background-color: green; color: white} |
||
110 | * |
||
111 | * {@inheritDoc} |
||
112 | */ |
||
113 | public function getFormatter()/*# : callable */ |
||
122 | |||
123 | /** |
||
124 | * Is 'browserhandler' header set ? |
||
125 | * |
||
126 | * @return bool |
||
127 | * @access protected |
||
128 | * @static |
||
129 | */ |
||
130 | protected static function hasHttpHeader()/*# : bool */ |
||
139 | |||
140 | /** |
||
141 | * Generate the javascript |
||
142 | * |
||
143 | * @return string |
||
144 | * @access protected |
||
145 | */ |
||
146 | protected static function generateScript()/*# : string */ |
||
157 | |||
158 | /** |
||
159 | * JS log method |
||
160 | * |
||
161 | * @param array $args |
||
162 | * @return string |
||
163 | * @access protected |
||
164 | */ |
||
165 | protected static function consoleLog(array $args)/*# : string */ |
||
169 | |||
170 | /** |
||
171 | * Format with styles in the message |
||
172 | * |
||
173 | * @param string $formatted |
||
174 | * @return array |
||
175 | * @access protected |
||
176 | */ |
||
177 | protected static function handleStyles( |
||
202 | |||
203 | /** |
||
204 | * @param string $style |
||
205 | * @param string $string |
||
206 | * @return string |
||
207 | * @access protected |
||
208 | */ |
||
209 | protected static function handleCustomStyles( |
||
235 | |||
236 | /** |
||
237 | * Quote $arg |
||
238 | * |
||
239 | * @param string $arg |
||
240 | * @return string |
||
241 | * @access protected |
||
242 | */ |
||
243 | protected static function quote(/*# string */ $arg)/*# : string */ |
||
247 | } |
||
248 |