Passed
Push — master ( 6ac744...48d05f )
by Mohammad
07:18
created

RoomController::enterRoom()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: shanmaseen
5
 * Date: 26/03/19
6
 * Time: 10:57 ص
7
 */
8
9
namespace Shamaseen\Laravel\Ratchet\Controllers;
10
11
12
use Shamaseen\Laravel\Ratchet\Traits\RoomUtility;
13
14
class RoomController extends WebSocketController
15
{
16
    use RoomUtility;
17
18
    /**
19
     * @param $room_id
20
     */
21
    function enterRoom($room_id)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Coding Style Naming introduced by
The variable $room_id is not named in camelCase.

This check marks variable names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
22
    {
23
        $this->validateRoom($room_id,true);
24
25
        $this->addMember($room_id);
26
    }
27
28
    /**
29
     * @param $room_id
30
     */
31
    function exitRoom($room_id)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Coding Style Naming introduced by
The variable $room_id is not named in camelCase.

This check marks variable names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
32
    {
33
        $this->validateRoom($room_id);
34
35
        $this->removeMember($room_id);
36
    }
37
}