Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
34 | public function onSessionStart($session, $transport) |
||
35 | { |
||
36 | |||
37 | |||
38 | $sessionMonitor = new SessionMonitor(new Adapter($session)); |
||
39 | |||
40 | |||
41 | $sessionMonitor->on('list', function ($l) { |
||
42 | echo "\nLIST: \n"; |
||
43 | print_r($l); |
||
44 | }); |
||
45 | |||
46 | $sessionMonitor->on('join', function ($l) { |
||
47 | echo "\nJOIN: \n"; |
||
48 | print_r($l); |
||
49 | }); |
||
50 | |||
51 | $sessionMonitor->on('leave', function ($l) { |
||
52 | echo "\nLEAVE: \n"; |
||
53 | print_r($l); |
||
54 | }); |
||
55 | |||
56 | $sessionMonitor->on('error', function ($l) { |
||
57 | echo "\nERROR: \n"; |
||
58 | print_r($l); |
||
59 | }); |
||
60 | |||
61 | $sessionMonitor->start(); |
||
62 | |||
63 | echo "\n******** SESSION MONITOR STARTED ********\n"; |
||
64 | |||
65 | } |
||
66 | |||
75 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.