EscolaLMS/Consultations

View on GitHub

Showing 985 of 985 total issues

Expected 1 space after USE keyword; found 0
Open

        return DB::transaction(function () use($id) {

Expected 1 blank line at end of file; 3 found
Open

}

Expected 1 blank line at end of file; 3 found
Open

});
Severity: Minor
Found in src/routes.php by phpcodesniffer

Expected 1 space after USE keyword; found 0
Open

        return DB::transaction(function () use($consultationDto) {

Expected 1 space after USE keyword; found 0
Open

        return DB::transaction(function () use($consultation, $consultationDto) {

The closing brace for the trait must go on the next line after the body
Open

}
Severity: Minor
Found in src/Dto/Traits/DtoHelper.php by phpcodesniffer

There must be one blank line after the last USE statement; 2 found;
Open

use EscolaLms\Core\Models\User as CoreUser;
Severity: Minor
Found in src/Models/Consultation.php by phpcodesniffer

The method getConsultationsList has a boolean flag argument $onlyActive, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getConsultationsList(array $search = [], bool $onlyActive = false, OrderDto $orderDto = null): Builder
Severity: Minor
Found in src/Services/ConsultationService.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method toArray has a boolean flag argument $filters, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function toArray($filters = false): array

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method toArray has a boolean flag argument $filters, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function toArray($filters = false): array;

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method toArray has a boolean flag argument $filters, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function toArray($filters = false): array
Severity: Minor
Found in src/Dto/ConsultationDto.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getConsultationsList has a boolean flag argument $onlyActive, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getConsultationsList(array $search = [], bool $onlyActive = false, OrderDto $orderDto = null): Builder;

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'down'.
Open

            !Schema::hasColumns('orders', ['executed_at', 'executed_status'])

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'up'.
Open

        Schema::dropIfExists('consultations_participants');

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'down'.
Open

        Schema::dropIfExists('category_consultation');

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'down'.
Open

            if (Schema::hasTable('orders')) {

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'up'.
Open

        Schema::table('consultation_user', function (Blueprint $table) {
            $table->bigInteger('product_id')->unsigned()->nullable();
            if (Schema::hasTable('products')) {
                $table->foreign('product_id')->on('products')->references('id')->nullOnDelete();
            }

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'up'.
Open

            if (Schema::hasTable('products')) {

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\Spatie\Permission\Models\Role' in method 'run'.
Open

        $tutor = Role::findOrCreate(UserRole::TUTOR, 'api');

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\Spatie\Permission\Models\Permission' in method 'run'.
Open

        Permission::findOrCreate(ConsultationsPermissionsEnum::CONSULTATION_LIST, 'api');

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Severity
Category
Status
Source
Language