| Conditions | 1 |
| Paths | 1 |
| Total Lines | 46 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 14 | public function run() |
||
| 15 | { |
||
| 16 | $this->header('Content-Type: text/html'); |
||
| 17 | ?> |
||
| 18 | <!DOCTYPE html> |
||
| 19 | <html> |
||
| 20 | <head> |
||
| 21 | <title>SockJS test page</title> |
||
| 22 | <script src="//cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"></script> |
||
| 23 | </head> |
||
| 24 | <body> |
||
| 25 | <script type="text/javascript"> |
||
| 26 | var sock, logElem; |
||
| 27 | |||
| 28 | function addLog(msg) { |
||
| 29 | logElem.innerHTML = msg + '<br />' + logElem.innerHTML; |
||
| 30 | } |
||
| 31 | |||
| 32 | function create() { |
||
| 33 | logElem = document.getElementById('log'); |
||
| 34 | sock = new SockJS('http://' + document.domain + ':8068/sockjs/'); |
||
| 35 | sock.onopen = function () { |
||
| 36 | addLog('SockJS opened'); |
||
| 37 | } |
||
| 38 | sock.onmessage = function (e) { |
||
| 39 | addLog('<<< : ' + e.data); |
||
| 40 | } |
||
| 41 | sock.onclose = function () { |
||
| 42 | addLog('closed'); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 46 | function send(data) { |
||
| 47 | sock && sock.send(data); |
||
| 48 | addLog('>>> : ' + data); |
||
| 49 | } |
||
| 50 | </script> |
||
| 51 | |||
| 52 | <button onclick="create();">Create SockJS</button> |
||
| 53 | <button onclick="send('ping');">Send ping</button> |
||
| 54 | <button onclick="sock && sock.close();">Close SockJS</button> |
||
| 55 | <div id="log" style="width:300px; height: 300px; border: 1px solid #999999; overflow:auto;"></div> |
||
| 56 | </body> |
||
| 57 | </html> |
||
| 58 | <?php |
||
| 59 | } |
||
| 60 | } |
||
| 61 |
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.