src/Repositories/Criteria/WebinarIncomingCriterion.php
Method apply
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function apply(Builder $query): Builder
{
if ($this->withDuration) {
return $query
->where(function (Builder $query) {
syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)
Open
Open
private ?bool $withDuration;
- Exclude checks
Line exceeds 120 characters; contains 204 characters Open
Open
WHEN SUBSTRING_INDEX(duration, ' ', -1) = 'seconds' or SUBSTRING_INDEX(duration, ' ', -1) = 'second' THEN DATE_ADD(active_to, INTERVAL SUBSTRING_INDEX(duration, ' ', 1) SECOND )
- Exclude checks
Line exceeds 120 characters; contains 172 characters Open
Open
->whereRaw("active_to + CASE WHEN (duration ~ '^\\d+$') THEN (duration || ' hours')::interval ELSE (duration)::interval END > ?", [$this->value])
- Exclude checks
Line exceeds 120 characters; contains 204 characters Open
Open
WHEN SUBSTRING_INDEX(duration, ' ', -1) = 'minutes' or SUBSTRING_INDEX(duration, ' ', -1) = 'minute' THEN DATE_ADD(active_to, INTERVAL SUBSTRING_INDEX(duration, ' ', 1) MINUTE )
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
Open
->where(fn (Builder $query) => $query->whereNull('duration')->where('webinars.active_to', '>', $this->value));
- Exclude checks
Line exceeds 120 characters; contains 198 characters Open
Open
WHEN SUBSTRING_INDEX(duration, ' ', -1) = 'week' or SUBSTRING_INDEX(duration, ' ', -1) = 'weeks' THEN DATE_ADD(active_to, INTERVAL SUBSTRING_INDEX(duration, ' ', 1) WEEK )
- Exclude checks
Line exceeds 120 characters; contains 201 characters Open
Open
WHEN SUBSTRING_INDEX(duration, ' ', -1) = 'month' or SUBSTRING_INDEX(duration, ' ', -1) = 'months' THEN DATE_ADD(active_to, INTERVAL SUBSTRING_INDEX(duration, ' ', 1) MONTH )
- Exclude checks
Line exceeds 120 characters; contains 198 characters Open
Open
WHEN SUBSTRING_INDEX(duration, ' ', -1) = 'year' or SUBSTRING_INDEX(duration, ' ', -1) = 'years' THEN DATE_ADD(active_to, INTERVAL SUBSTRING_INDEX(duration, ' ', 1) YEAR )
- Exclude checks
Line exceeds 120 characters; contains 195 characters Open
Open
WHEN SUBSTRING_INDEX(duration, ' ', -1) = 'days' or SUBSTRING_INDEX(duration, ' ', -1) = 'day' THEN DATE_ADD(active_to, INTERVAL SUBSTRING_INDEX(duration, ' ', 1) DAY )
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
->where(fn (Builder $query) => $query->whereNull('duration')->where('webinars.active_to', '>', $this->value));
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 19 Open
Open
$query = $query
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 23 Open
Open
return $query->orWhere(fn (Builder $query) => $query
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
return $query->orWhere(fn (Builder $query) => $query
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 19 Open
Open
return $query->orWhere(fn (Builder $query) => $query
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 19 Open
Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
return $query->orWhere(fn (Builder $query) => $query
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 19 Open
Open
if (DB::connection()->getPdo()->getAttribute(\PDO::ATTR_DRIVER_NAME) === 'pgsql') {
- Exclude checks
Line indented incorrectly; expected at least 25 spaces, found 23 Open
Open
);
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 19 Open
Open
);
- Exclude checks
Expected 0 spaces before closing bracket; newline found Open
Open
return $query->orWhere(fn (Builder $query) => $query
- Exclude checks
Expected 0 spaces before closing bracket; newline found Open
Open
return $query->orWhere(fn (Builder $query) => $query
- Exclude checks