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;
- Read upRead up
- Exclude checks
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 $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;
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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
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;
- Exclude checks
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;
- Exclude checks
Possibly zero references to use statement for classlike/namespace Collection
(\Illuminate\Support\Collection)
Open
use Illuminate\Support\Collection;
- Exclude checks
Possibly zero references to use statement for classlike/namespace AnonymousResourceCollection
(\Illuminate\Http\Resources\Json\AnonymousResourceCollection)
Open
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
- Exclude checks
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;
- Exclude checks
Parameter $webinarDto
has undeclared type \EscolaLms\Webinar\Dto\WebinarDto
Open
public function store(WebinarDto $webinarDto): Webinar;
- Exclude checks
Return type of getWebinarEndDate()
is undeclared type ?\Carbon\Carbon
Open
public function getWebinarEndDate(Webinar $webinar): ?Carbon;
- Exclude checks
Return type of getWebinarsListForCurrentUser()
is undeclared type \Illuminate\Database\Eloquent\Builder
Open
public function getWebinarsListForCurrentUser(array $search = []): Builder;
- Exclude checks
Parameter $webinarDto
has undeclared type \EscolaLms\Webinar\Dto\WebinarDto
Open
public function update(int $id, WebinarDto $webinarDto): Webinar;
- Exclude checks
Avoid excessively long variable names like $webinarSimpleResource. Keep variable name length under 20. Open
public function extendResponse($webinarSimpleResource, $isApi = false);
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Exclude checks