EscolaLMS/Webinar

View on GitHub
src/Services/Contracts/WebinarServiceContract.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    public function getWebinarsList(array $search = [], bool $onlyActive = false, ?OrderDto $orderDto = null, bool $onlyIncoming = false): 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

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

    public function getWebinarsList(array $search = [], bool $onlyActive = false, ?OrderDto $orderDto = null, bool $onlyIncoming = false): 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

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

    public function extendResponse($webinarSimpleResource, $isApi = false);

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

Possibly zero references to use statement for classlike/namespace AnonymousResourceCollection (\Illuminate\Http\Resources\Json\AnonymousResourceCollection)
Open

use Illuminate\Http\Resources\Json\AnonymousResourceCollection;

Possibly zero references to use statement for classlike/namespace Collection (\Illuminate\Support\Collection)
Open

use Illuminate\Support\Collection;

Parameter $orderDto has undeclared type ?\EscolaLms\Core\Dtos\OrderDto
Open

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

Return type of getWebinarsList() is undeclared type \Illuminate\Database\Eloquent\Builder
Open

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

Parameter $user has undeclared type \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Webinar\Models\User)
Open

    public function isTrainer(User $user, Webinar $webinar): bool;

Parameter $webinarDto has undeclared type \EscolaLms\Webinar\Dto\WebinarDto
Open

    public function store(WebinarDto $webinarDto): Webinar;

Return type of getWebinarEndDate() is undeclared type ?\Carbon\Carbon
Open

    public function getWebinarEndDate(Webinar $webinar): ?Carbon;

Return type of getWebinarsListForCurrentUser() is undeclared type \Illuminate\Database\Eloquent\Builder
Open

    public function getWebinarsListForCurrentUser(array $search = []): Builder;

Parameter $webinarDto has undeclared type \EscolaLms\Webinar\Dto\WebinarDto
Open

    public function update(int $id, WebinarDto $webinarDto): Webinar;

Avoid excessively long variable names like $webinarSimpleResource. Keep variable name length under 20.
Open

    public function extendResponse($webinarSimpleResource, $isApi = false);

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public function delete(int $id): ?bool;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public function show(int $id): Webinar;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public function update(int $id, WebinarDto $webinarDto): Webinar;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Line exceeds 120 characters; contains 147 characters
Open

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

There are no issues that match your filters.

Category
Status