diff --git a/app/Form/Actions/FormApiListAction.php b/app/Form/Actions/FormApiListAction.php index 3c74d1e8..b7e1ace5 100644 --- a/app/Form/Actions/FormApiListAction.php +++ b/app/Form/Actions/FormApiListAction.php @@ -16,7 +16,7 @@ class FormApiListAction /** * @param string $filter - * @return LengthAwarePaginator
+ * @return LengthAwarePaginator */ public function handle(string $filter, int $perPage): LengthAwarePaginator { diff --git a/app/Form/Actions/FormIndexAction.php b/app/Form/Actions/FormIndexAction.php index 3f62031f..21b116f4 100644 --- a/app/Form/Actions/FormIndexAction.php +++ b/app/Form/Actions/FormIndexAction.php @@ -16,7 +16,7 @@ class FormIndexAction use AsAction; /** - * @return LengthAwarePaginator + * @return LengthAwarePaginator */ public function handle(string $filter): LengthAwarePaginator { diff --git a/app/Form/Actions/FormtemplateIndexAction.php b/app/Form/Actions/FormtemplateIndexAction.php index 91560bbf..63cbfcf8 100644 --- a/app/Form/Actions/FormtemplateIndexAction.php +++ b/app/Form/Actions/FormtemplateIndexAction.php @@ -14,7 +14,7 @@ class FormtemplateIndexAction use AsAction; /** - * @return LengthAwarePaginator + * @return LengthAwarePaginator */ public function handle(): LengthAwarePaginator { diff --git a/app/Initialize/Actions/NamiSearchAction.php b/app/Initialize/Actions/NamiSearchAction.php index 260a81c0..75ea80ff 100644 --- a/app/Initialize/Actions/NamiSearchAction.php +++ b/app/Initialize/Actions/NamiSearchAction.php @@ -16,7 +16,7 @@ class NamiSearchAction /** * @param array $params * - * @return LengthAwarePaginator + * @return LengthAwarePaginator */ public function handle(Api $api, int $page, array $params, int $perPage = 10): LengthAwarePaginator { @@ -36,7 +36,7 @@ class NamiSearchAction } /** - * @return LengthAwarePaginator + * @return LengthAwarePaginator */ public function asController(ActionRequest $request): LengthAwarePaginator { diff --git a/app/Lib/HasDataMeta.php b/app/Lib/HasDataMeta.php new file mode 100644 index 00000000..8c0b4cac --- /dev/null +++ b/app/Lib/HasDataMeta.php @@ -0,0 +1,22 @@ + + */ + 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()] + ]; + } +} diff --git a/app/Lib/HasMeta.php b/app/Lib/HasMeta.php index bc27aeaa..45e57181 100644 --- a/app/Lib/HasMeta.php +++ b/app/Lib/HasMeta.php @@ -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()] - ]; - } } diff --git a/app/Member/Data/MembershipData.php b/app/Member/Data/MembershipData.php index 0fc72582..d6c9b51c 100644 --- a/app/Member/Data/MembershipData.php +++ b/app/Member/Data/MembershipData.php @@ -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 $links + */ public function __construct( public int $id, public RecordData $activity, @@ -49,6 +52,9 @@ class MembershipData extends Data ]); } + /** + * @return array + */ public static function meta(): array { return [ 'activities' => RecordData::collect(Activity::get()), diff --git a/app/Membership/Actions/MassStoreAction.php b/app/Membership/Actions/MassStoreAction.php index a943e5b6..d4773e24 100644 --- a/app/Membership/Actions/MassStoreAction.php +++ b/app/Membership/Actions/MassStoreAction.php @@ -21,7 +21,7 @@ class MassStoreAction use TracksJob; /** - * @return array + * @return array */ public function rules(): array { @@ -87,6 +87,9 @@ class MassStoreAction return response()->json([], 200); } + /** + * @return array + */ public function getValidationAttributes(): array { return [ 'activity_id' => 'Tätigkeit', diff --git a/app/Remote/Actions/SearchAction.php b/app/Remote/Actions/SearchAction.php index e533ca9a..996127c1 100644 --- a/app/Remote/Actions/SearchAction.php +++ b/app/Remote/Actions/SearchAction.php @@ -14,7 +14,7 @@ class SearchAction use AsAction; /** - * @return LengthAwarePaginator> + * @return LengthAwarePaginator> */ public function handle(ActionRequest $request): LengthAwarePaginator { diff --git a/packages/laravel-nami b/packages/laravel-nami index c20cf930..35bed018 160000 --- a/packages/laravel-nami +++ b/packages/laravel-nami @@ -1 +1 @@ -Subproject commit c20cf930f2037ddda4400dd7d35bf9ef707356eb +Subproject commit 35bed01848492471d6e4141f303f74ab19d1fc09 diff --git a/phpstan.neon b/phpstan.neon index 3d85785d..a8b3de15 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -418,11 +418,6 @@ parameters: count: 1 path: app/Mailgateway/Resources/MailgatewayResource.php - - - message: "#^Generic type Illuminate\\\\Pagination\\\\LengthAwarePaginator\\ 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