This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace PHPDaemon\SockJS; |
||
3 | |||
4 | /** |
||
5 | * @package Libraries |
||
6 | * @subpackage SockJS |
||
7 | * @author Vasily Zorin <[email protected]> |
||
8 | */ |
||
9 | class WebSocketConnectionProxy implements \PHPDaemon\WebSocket\RouteInterface |
||
10 | { |
||
11 | use \PHPDaemon\Traits\StaticObjectWatchdog; |
||
12 | |||
13 | protected $realConn; |
||
14 | |||
15 | protected $sockjs; |
||
16 | |||
17 | /** |
||
18 | * __construct |
||
19 | * @param Application $sockjs |
||
20 | * @param object $conn |
||
21 | */ |
||
22 | public function __construct($sockjs, $conn) |
||
23 | { |
||
24 | $this->sockjs = $sockjs; |
||
25 | $this->realConn = $conn; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * __get |
||
30 | * @param string $k |
||
31 | * @return mixed |
||
32 | */ |
||
33 | public function &__get($k) |
||
34 | { |
||
35 | if (!isset($this->realConn->{$k})) { |
||
36 | return $dummy; |
||
0 ignored issues
–
show
|
|||
37 | } |
||
38 | return $this->realConn->{$k}; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * __set |
||
43 | * * @param string $k Key |
||
44 | * * @param mixed $$v Value |
||
0 ignored issues
–
show
There is no parameter named
$$v . Was it maybe removed?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. Consider the following example. The parameter /**
* @param array $germany
* @param array $island
* @param array $italy
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was removed, but the annotation was not. ![]() |
|||
45 | * @return mixed |
||
46 | */ |
||
47 | public function __set($k, $v) |
||
48 | { |
||
49 | return $this->realConn->{$k} = $v; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * __isset |
||
54 | * @param string $k |
||
55 | * @return boolean |
||
56 | */ |
||
57 | public function __isset($k) |
||
58 | { |
||
59 | return isset($this->realConn->{$k}); |
||
60 | } |
||
61 | |||
62 | |||
63 | /** |
||
64 | * Called when new frame received. |
||
65 | * @param string $data Frame's data. |
||
66 | * @param string $type Frame's type ("STRING" OR "BINARY"). |
||
67 | * @return boolean Success. |
||
0 ignored issues
–
show
|
|||
68 | */ |
||
69 | public function onFrame($data, $type) |
||
70 | { |
||
71 | $this->realConn->onFrame($data, $type); |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * __call |
||
76 | * @param string $method |
||
77 | * @param array $args |
||
78 | * @return mixed |
||
79 | */ |
||
80 | public function __call($method, $args) |
||
81 | { |
||
82 | $func = [$this->realConn, $method]; |
||
83 | return $func(...$args); |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * Sends a frame. |
||
88 | * @param string $data Frame's data. |
||
89 | * @param integer $type Frame's type. See the constants. |
||
0 ignored issues
–
show
Should the type for parameter
$type not be integer|null ?
This check looks for It makes a suggestion as to what type it considers more descriptive. Most often this is a case of a parameter that can be null in addition to its declared types. ![]() |
|||
90 | * @param callback $cb Optional. Callback called when the frame is received by client. |
||
0 ignored issues
–
show
Should the type for parameter
$cb not be callable|null ?
This check looks for It makes a suggestion as to what type it considers more descriptive. Most often this is a case of a parameter that can be null in addition to its declared types. ![]() |
|||
91 | * @callback $cb ( ) |
||
92 | * @return boolean Success. |
||
93 | */ |
||
94 | public function sendFrame($data, $type = null, $cb = null) |
||
95 | { |
||
96 | $this->realConn->sendFrame('a' . $this->toJson([$data]), $type, $cb); |
||
0 ignored issues
–
show
array($data) is of type array<integer,string,{"0":"string"}> , but the function expects a string .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
![]() |
|||
97 | return true; |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * toJson |
||
102 | * @param string $p |
||
103 | * @return string |
||
104 | */ |
||
105 | public function toJson($p) |
||
106 | { |
||
107 | return json_encode($p, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); |
||
108 | } |
||
109 | |||
110 | /** |
||
111 | * Sends a frame. |
||
112 | * @param string $data Frame's data. |
||
113 | * @param integer $type Frame's type. See the constants. |
||
0 ignored issues
–
show
Should the type for parameter
$type not be integer|null ?
This check looks for It makes a suggestion as to what type it considers more descriptive. Most often this is a case of a parameter that can be null in addition to its declared types. ![]() |
|||
114 | * @param callback $cb Optional. Callback called when the frame is received by client. |
||
0 ignored issues
–
show
Should the type for parameter
$cb not be callable|null ?
This check looks for It makes a suggestion as to what type it considers more descriptive. Most often this is a case of a parameter that can be null in addition to its declared types. ![]() |
|||
115 | * @callback $cb ( ) |
||
116 | * @return boolean Success. |
||
117 | */ |
||
118 | public function sendFrameReal($data, $type = null, $cb = null) |
||
119 | { |
||
120 | $this->realConn->sendFrame($data, $type, $cb); |
||
121 | return true; |
||
122 | } |
||
123 | } |
||
124 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.