MockableConnection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 4
c 3
b 1
f 0
dl 0
loc 35
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A close() 0 2 1
A send() 0 2 1
A __construct() 0 6 1
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Server;
4
5
use Ratchet\ConnectionInterface;
6
use stdClass;
7
8
class MockableConnection implements ConnectionInterface
9
{
10
    /**
11
     * Create a new Mockable connection.
12
     *
13
     * @param  string|int  $appId
14
     * @param  string  $socketId
15
     * @return void
16
     */
17
    public function __construct($appId, string $socketId)
18
    {
19
        $this->app = new stdClass;
0 ignored issues
show
Bug Best Practice introduced by
The property app does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
20
21
        $this->app->id = $appId;
22
        $this->socketId = $socketId;
0 ignored issues
show
Bug Best Practice introduced by
The property socketId does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
23
    }
24
25
    /**
26
     * Send data to the connection.
27
     *
28
     * @param  string  $data
29
     * @return \Ratchet\ConnectionInterface
30
     */
31
    public function send($data)
32
    {
33
        //
34
    }
35
36
    /**
37
     * Close the connection.
38
     *
39
     * @return void
40
     */
41
    public function close()
42
    {
43
        //
44
    }
45
}
46