Lint
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
philipp lang 2024-05-14 09:38:18 +02:00
parent c0daff972b
commit e10742d298
2 changed files with 8 additions and 4 deletions

View File

@ -2,18 +2,16 @@
namespace App\Invoice\Scopes;
use App\Form\Models\Form;
use App\Form\Models\Participant;
use App\Invoice\Enums\InvoiceStatus;
use App\Invoice\Models\Invoice;
use App\Lib\Filter;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Spatie\LaravelData\Attributes\MapInputName;
use Spatie\LaravelData\Attributes\MapOutputName;
use Spatie\LaravelData\Mappers\SnakeCaseMapper;
/**
* @extends Filter<Participant>
* @extends Filter<Invoice>
*/
#[MapInputName(SnakeCaseMapper::class)]
#[MapOutputName(SnakeCaseMapper::class)]
@ -37,6 +35,9 @@ class InvoiceFilterScope extends Filter
return $query;
}
/**
* @inheritdoc
*/
public function toDefault(): self
{
$this->statuses = $this->statuses === null ? InvoiceStatus::defaultVisibleValues()->toArray() : $this->statuses;

View File

@ -39,6 +39,9 @@ abstract class Filter extends Data
return static::withoutMagicalCreationFrom($post ?: [])->toDefault();
}
/**
* @return static(self<T>)
*/
public function toDefault(): self
{
return $this;