| Conditions | 1 |
| Paths | 1 |
| Total Lines | 38 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function run() |
||
| 14 | { |
||
| 15 | $this->header('Content-Type: text/html'); |
||
| 16 | ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
||
| 17 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||
| 18 | <html xmlns="http://www.w3.org/1999/xhtml"> |
||
| 19 | <head> |
||
| 20 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
||
| 21 | <title>WebSocket test page</title> |
||
| 22 | </head> |
||
| 23 | <body> |
||
| 24 | <script type="text/javascript"> |
||
| 25 | function create() { |
||
| 26 | // Example |
||
| 27 | ws = new WebSocket('ws://' + document.domain + ':8047/ExamplePubSub'); |
||
| 28 | ws.onopen = function () { |
||
| 29 | document.getElementById('log').innerHTML += 'WebSocket opened <br/>'; |
||
| 30 | } |
||
| 31 | ws.onmessage = function (e) { |
||
| 32 | document.getElementById('log').innerHTML += 'WebSocket message: ' + e.data + ' <br/>'; |
||
| 33 | } |
||
| 34 | ws.onclose = function () { |
||
| 35 | document.getElementById('log').innerHTML += 'WebSocket closed <br/>'; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | function subscribe() { |
||
| 39 | ws.send('{"type":"subscribe","event":"usersNum"}'); |
||
| 40 | } |
||
| 41 | </script> |
||
| 42 | <button onclick="create();">Create WebSocket</button> |
||
| 43 | <button onclick="subscribe();">Send subscribe</button> |
||
| 44 | <button onclick="ws.close();">Close WebSocket</button> |
||
| 45 | <div id="log" style="width:300px; height: 300px; border: 1px solid #999999; overflow:auto;"></div> |
||
| 46 | </body> |
||
| 47 | </html> |
||
| 48 | <?php |
||
| 49 | |||
| 50 | } |
||
| 51 | } |
||
| 52 |
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.