chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/CourseChatUtils.php

Summary

Maintainability
A
0 mins
Test Coverage

The method readMessages() has an NPath complexity of 2016. The configured NPath complexity threshold is 200.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

Avoid using undefined variables such as '$basename_chat' which will lead to PHP notices.
Open

        if (file_exists($chat_path.$basename_chat.'.log.html')) {

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$basename_chat' which will lead to PHP notices.
Open

            $content = file($chat_path.$basename_chat.'.log.html');

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$chat_path' which will lead to PHP notices.
Open

        if (file_exists($chat_path.$basename_chat.'.log.html')) {

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$chat_path' which will lead to PHP notices.
Open

            $content = file($chat_path.$basename_chat.'.log.html');

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

The class CourseChatUtils has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13.
Open

class CourseChatUtils
{
    private $groupId;
    private $courseId;
    private $sessionId;

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Missing class import via use statement (line '221', column '57').
Open

        $now = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '261', column '28').
Open

        $currentTime = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '221', column '20').
Open

        $now = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '261', column '65').
Open

        $currentTime = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '693', column '21').
Open

        $date = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '693', column '58').
Open

        $date = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '536', column '21').
Open

        $date = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '536', column '58').
Open

        $date = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method getFileName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $base = 'messages-'.$date.'_uid-'.$friendId.'-'.$this->userId.'.log.html';
            }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method saveMessage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId;
            }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method saveMessage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $fileContent = '
                <div class="message-student">
                    <img class="chat-image" src="'.$userPhoto.'">
                    <div class="icon-message"></div>

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method keepUserAsConnected uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $extraCondition = 'AND ccc.sessionId = '.$this->sessionId;
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method readMessages uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $filename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId.'-log.html';
            }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getUsersSubscriptions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $criteria->andWhere(
                        Criteria::expr()->eq('status', Session::COURSE_COACH)
                    );
                }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method listUsersOnline uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            /** @var CourseRelUser|SessionRelCourseRelUser $subscription */
            foreach ($subscriptions as $subscription) {
                $user = $subscription->getUser();
                $usersInfo[] = $this->formatUser(

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method userIsConnected uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $extraCondition = 'AND ccc.sessionId = '.$this->sessionId;
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method countUsersOnline uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $extraCondition = 'AND ccc.sessionId = '.$this->sessionId;
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused local variables such as '$courseInfo'.
Open

        $courseInfo = api_get_course_info_by_id($this->courseId);

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused parameters such as '$reset'.
Open

    public function readMessages($reset = false, $friendId = 0)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused local variables such as '$courseInfo'.
Open

        $courseInfo = api_get_course_info_by_id($this->courseId);

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$group_info'.
Open

            $group_info = GroupManager:: get_group_properties($this->groupId);

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Variable "date_now" is not in valid camel caps format
Open

                $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId;

Variable "date_now" is not in valid camel caps format
Open

        $date_now = date('Y-m-d');

Variable "document_path" is not in valid camel caps format
Open

        $document_path = '/document';

Variable "document_path" is not in valid camel caps format
Open

        $chatPath = $document_path.'/chat_files/';

Variable "filename_chat" is not in valid camel caps format
Open

            $resource->setTitle($filename_chat);

Variable "nbr_lines" is not in valid camel caps format
Open

            $nbr_lines = sizeof($content);

Variable "this_line" is not in valid camel caps format
Open

            $history .= $this_line;

Variable "date_now" is not in valid camel caps format
Open

            $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId;

Variable "document_path" is not in valid camel caps format
Open

            $chatPath = $document_path.$group_info['directory'].'/chat_files/';

Variable "filename_chat" is not in valid camel caps format
Open

            $filename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId.'-log.html';

Variable "date_now" is not in valid camel caps format
Open

            $filename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId.'-log.html';

Variable "basename_chat" is not in valid camel caps format
Open

            $content = file($chat_path.$basename_chat.'.log.html');

Variable "date_now" is not in valid camel caps format
Open

        $basename_chat = 'messages-'.$date_now;

Variable "filename_chat" is not in valid camel caps format
Open

            $filename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId.'-log.html';

Variable "date_now" is not in valid camel caps format
Open

            $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId;

Variable "basename_chat" is not in valid camel caps format
Open

                $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId;

Variable "this_line" is not in valid camel caps format
Open

        foreach ($content as $this_line) {

Variable "basename_chat" is not in valid camel caps format
Open

            $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId;

Variable "date_now" is not in valid camel caps format
Open

                $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId;

Variable "group_info" is not in valid camel caps format
Open

            $chatPath = $document_path.$group_info['directory'].'/chat_files/';

Variable "date_count_time_seconds" is not in valid camel caps format
Open

            if (($cd_count_time_seconds - $date_count_time_seconds) <= 5) {

Variable "group_info" is not in valid camel caps format
Open

            $group_info = GroupManager::get_group_properties($this->groupId);

Variable "filename_chat" is not in valid camel caps format
Open

                $filename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId.'-log.html';

Variable "basename_chat" is not in valid camel caps format
Open

                $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId;

Variable "date_now" is not in valid camel caps format
Open

            $filename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId.'-log.html';

Variable "filename_chat" is not in valid camel caps format
Open

                $filename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId.'-log.html';

Variable "basename_chat" is not in valid camel caps format
Open

        if (file_exists($chat_path.$basename_chat.'.log.html')) {

Variable "date_now" is not in valid camel caps format
Open

        $filename_chat = 'messages-'.$date_now.'-log.html';

Variable "chat_path" is not in valid camel caps format
Open

        if (file_exists($chat_path.$basename_chat.'.log.html')) {

Variable "chat_path" is not in valid camel caps format
Open

            $content = file($chat_path.$basename_chat.'.log.html');

Variable "basename_chat" is not in valid camel caps format
Open

        $basename_chat = 'messages-'.$date_now;

Variable "basename_chat" is not in valid camel caps format
Open

            $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId;

Variable "basename_chat" is not in valid camel caps format
Open

        $fileTitle = $basename_chat.'-log.html';

Variable "date_now" is not in valid camel caps format
Open

                $filename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId.'-log.html';

Variable "cd_count_time_seconds" is not in valid camel caps format
Open

        $cd_count_time_seconds = $now->getTimestamp();

Variable "date_count_time_seconds" is not in valid camel caps format
Open

            $date_count_time_seconds = $connection->getLastConnection()->getTimestamp();

Variable "date_now" is not in valid camel caps format
Open

                $filename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId.'-log.html';

Variable "filename_chat" is not in valid camel caps format
Open

        $filename_chat = 'messages-'.$date_now.'-log.html';

Variable "filename_chat" is not in valid camel caps format
Open

            'slug' => $filename_chat,

Variable "filename_chat" is not in valid camel caps format
Open

            $file = new UploadedFile($meta['uri'], $filename_chat, 'text/html', null, true);

Variable "nbr_lines" is not in valid camel caps format
Open

            $remove = $nbr_lines - 100;

Variable "date_now" is not in valid camel caps format
Open

        $date_now = date('Y-m-d');

Variable "cd_count_time_seconds" is not in valid camel caps format
Open

            if (($cd_count_time_seconds - $date_count_time_seconds) <= 5) {

Variable "group_info" is not in valid camel caps format
Open

            $group_info = GroupManager:: get_group_properties($this->groupId);

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $group_info is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $cd_count_time_seconds is not named in camelCase.
Open

    public function disconnectInactiveUsers()
    {
        $em = Database::getManager();
        $extraCondition = "AND ccc.toGroupId = {$this->groupId}";
        if (empty($this->groupId)) {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $cd_count_time_seconds is not named in camelCase.
Open

    public function disconnectInactiveUsers()
    {
        $em = Database::getManager();
        $extraCondition = "AND ccc.toGroupId = {$this->groupId}";
        if (empty($this->groupId)) {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $document_path is not named in camelCase.
Open

    public function getFileName($absolute = false, $friendId = 0)
    {
        $date = date('Y-m-d');
        $base = 'messages-'.$date.'.log.html';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $filename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $document_path is not named in camelCase.
Open

    public function getFileName($absolute = false, $friendId = 0)
    {
        $date = date('Y-m-d');
        $base = 'messages-'.$date.'.log.html';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $group_info is not named in camelCase.
Open

    public function getFileName($absolute = false, $friendId = 0)
    {
        $date = date('Y-m-d');
        $base = 'messages-'.$date.'.log.html';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $chat_path is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_count_time_seconds is not named in camelCase.
Open

    public function disconnectInactiveUsers()
    {
        $em = Database::getManager();
        $extraCondition = "AND ccc.toGroupId = {$this->groupId}";
        if (empty($this->groupId)) {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $nbr_lines is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $basename_chat is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $group_info is not named in camelCase.
Open

    public function getFileName($absolute = false, $friendId = 0)
    {
        $date = date('Y-m-d');
        $base = 'messages-'.$date.'.log.html';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $chat_path is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_now is not named in camelCase.
Open

    public function saveMessage($message, $friendId = 0)
    {
        if (empty($message)) {
            return false;
        }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $date_count_time_seconds is not named in camelCase.
Open

    public function disconnectInactiveUsers()
    {
        $em = Database::getManager();
        $extraCondition = "AND ccc.toGroupId = {$this->groupId}";
        if (empty($this->groupId)) {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $document_path is not named in camelCase.
Open

    public function getFileName($absolute = false, $friendId = 0)
    {
        $date = date('Y-m-d');
        $base = 'messages-'.$date.'.log.html';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $this_line is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $nbr_lines is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $this_line is not named in camelCase.
Open

    public function readMessages($reset = false, $friendId = 0)
    {
        $courseInfo = api_get_course_info_by_id($this->courseId);
        $date_now = date('Y-m-d');
        $isMaster = (bool) api_is_course_admin();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status