| Conditions | 1 |
| Paths | 1 |
| Total Lines | 46 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function run() |
||
| 13 | { |
||
| 14 | $this->header('Content-Type: text/html'); |
||
| 15 | ?> |
||
| 16 | <!DOCTYPE html> |
||
| 17 | <html> |
||
| 18 | <head> |
||
| 19 | <title>SockJS test page</title> |
||
| 20 | <script src="//cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"></script> |
||
| 21 | </head> |
||
| 22 | <body> |
||
| 23 | <script> |
||
| 24 | var sock, logElem; |
||
| 25 | |||
| 26 | function addLog(msg) { |
||
| 27 | logElem.innerHTML = msg + '<br />' + logElem.innerHTML; |
||
| 28 | } |
||
| 29 | |||
| 30 | function create() { |
||
| 31 | logElem = document.getElementById('log'); |
||
| 32 | sock = new SockJS('http://' + document.domain + ':8068/sockjs/'); |
||
| 33 | sock.onopen = function () { |
||
| 34 | addLog('SockJS opened'); |
||
| 35 | } |
||
| 36 | sock.onmessage = function (e) { |
||
| 37 | addLog('<<< : ' + e.data); |
||
| 38 | } |
||
| 39 | sock.onclose = function () { |
||
| 40 | addLog('closed'); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | function send(data) { |
||
| 45 | sock && sock.send(data); |
||
| 46 | addLog('>>> : ' + data); |
||
| 47 | } |
||
| 48 | </script> |
||
| 49 | |||
| 50 | <button onclick="create();">Create SockJS</button> |
||
| 51 | <button onclick="send('ping');">Send ping</button> |
||
| 52 | <button onclick="sock && sock.close();">Close SockJS</button> |
||
| 53 | <div id="log" style="width:300px; height: 300px; border: 1px solid #999999; overflow:auto;"></div> |
||
| 54 | </body> |
||
| 55 | </html> |
||
| 56 | <?php |
||
| 57 | } |
||
| 58 | } |
||
| 59 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.