Lint
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
88e020ac4e
commit
ab442dff9b
|
@ -16,7 +16,7 @@ class FormApiListAction
|
|||
|
||||
/**
|
||||
* @param string $filter
|
||||
* @return LengthAwarePaginator<Form>
|
||||
* @return LengthAwarePaginator<int, Form>
|
||||
*/
|
||||
public function handle(string $filter, int $perPage): LengthAwarePaginator
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ class FormIndexAction
|
|||
use AsAction;
|
||||
|
||||
/**
|
||||
* @return LengthAwarePaginator<Form>
|
||||
* @return LengthAwarePaginator<int, Form>
|
||||
*/
|
||||
public function handle(string $filter): LengthAwarePaginator
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ class FormtemplateIndexAction
|
|||
use AsAction;
|
||||
|
||||
/**
|
||||
* @return LengthAwarePaginator<Formtemplate>
|
||||
* @return LengthAwarePaginator<int, Formtemplate>
|
||||
*/
|
||||
public function handle(): LengthAwarePaginator
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ class NamiSearchAction
|
|||
/**
|
||||
* @param array<string, mixed> $params
|
||||
*
|
||||
* @return LengthAwarePaginator<MemberEntry>
|
||||
* @return LengthAwarePaginator<int, MemberEntry>
|
||||
*/
|
||||
public function handle(Api $api, int $page, array $params, int $perPage = 10): LengthAwarePaginator
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ class NamiSearchAction
|
|||
}
|
||||
|
||||
/**
|
||||
* @return LengthAwarePaginator<MemberEntry>
|
||||
* @return LengthAwarePaginator<int, MemberEntry>
|
||||
*/
|
||||
public function asController(ActionRequest $request): LengthAwarePaginator
|
||||
{
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Lib;
|
||||
|
||||
use Spatie\LaravelData\PaginatedDataCollection;
|
||||
|
||||
/**
|
||||
* @mixin Spatie\LaravelData\Data
|
||||
*/
|
||||
trait HasDataMeta
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function collectPages(mixed $items): array {
|
||||
$source = parent::collect($items, PaginatedDataCollection::class)->toArray();
|
||||
return [
|
||||
...parent::collect($items, PaginatedDataCollection::class)->toArray(),
|
||||
'meta' => [...$source['meta'], ...static::meta()]
|
||||
];
|
||||
}
|
||||
}
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace App\Lib;
|
||||
|
||||
use Spatie\LaravelData\PaginatedDataCollection;
|
||||
|
||||
/** @mixin \Illuminate\Http\Resources\Json\JsonResource */
|
||||
/**
|
||||
* @mixin \Illuminate\Http\Resources\Json\JsonResource
|
||||
*/
|
||||
trait HasMeta
|
||||
{
|
||||
/**
|
||||
|
@ -43,12 +43,4 @@ trait HasMeta
|
|||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public static function collectPages(mixed $items): array {
|
||||
$source = parent::collect($items, PaginatedDataCollection::class)->toArray();
|
||||
return [
|
||||
...parent::collect($items, PaginatedDataCollection::class)->toArray(),
|
||||
'meta' => [...$source['meta'], ...static::meta()]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use App\Group;
|
|||
use Spatie\LaravelData\Data;
|
||||
use App\Lib\Data\DateData;
|
||||
use App\Lib\Data\RecordData;
|
||||
use App\Lib\HasMeta;
|
||||
use App\Lib\HasDataMeta;
|
||||
use App\Member\Membership;
|
||||
use App\Membership\FilterScope;
|
||||
use App\Subactivity;
|
||||
|
@ -15,8 +15,11 @@ use App\Subactivity;
|
|||
class MembershipData extends Data
|
||||
{
|
||||
|
||||
use HasMeta;
|
||||
use HasDataMeta;
|
||||
|
||||
/**
|
||||
* @param array<string, string> $links
|
||||
*/
|
||||
public function __construct(
|
||||
public int $id,
|
||||
public RecordData $activity,
|
||||
|
@ -49,6 +52,9 @@ class MembershipData extends Data
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function meta(): array {
|
||||
return [
|
||||
'activities' => RecordData::collect(Activity::get()),
|
||||
|
|
|
@ -21,7 +21,7 @@ class MassStoreAction
|
|||
use TracksJob;
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
@ -87,6 +87,9 @@ class MassStoreAction
|
|||
return response()->json([], 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getValidationAttributes(): array {
|
||||
return [
|
||||
'activity_id' => 'Tätigkeit',
|
||||
|
|
|
@ -14,7 +14,7 @@ class SearchAction
|
|||
use AsAction;
|
||||
|
||||
/**
|
||||
* @return LengthAwarePaginator<array<string, mixed>>
|
||||
* @return LengthAwarePaginator<int, array<string, mixed>>
|
||||
*/
|
||||
public function handle(ActionRequest $request): LengthAwarePaginator
|
||||
{
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c20cf930f2037ddda4400dd7d35bf9ef707356eb
|
||||
Subproject commit 35bed01848492471d6e4141f303f74ab19d1fc09
|
|
@ -418,11 +418,6 @@ parameters:
|
|||
count: 1
|
||||
path: app/Mailgateway/Resources/MailgatewayResource.php
|
||||
|
||||
-
|
||||
message: "#^Generic type Illuminate\\\\Pagination\\\\LengthAwarePaginator\\<int, App\\\\Member\\\\Member\\> in PHPDoc tag @return specifies 2 template types, but class Illuminate\\\\Pagination\\\\LengthAwarePaginator supports only 1\\: TValue$#"
|
||||
count: 1
|
||||
path: app/Member/Actions/SearchAction.php
|
||||
|
||||
-
|
||||
message: "#^Class Plugins\\\\Test\\\\ServiceProvider not found\\.$#"
|
||||
count: 1
|
||||
|
|
Loading…
Reference in New Issue