From 0b65b68e6ede689a00116ba02ff352416a987fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Buli=C5=84ski?= Date: Thu, 21 Sep 2023 03:38:40 +0200 Subject: [PATCH] Pint update --- app/Casts/MetadataValue.php | 2 +- app/Criteria/ProductAttributeSearch.php | 4 +- app/Criteria/ProductNotAttributeSearch.php | 4 +- app/Criteria/WhereHasBuyer.php | 4 +- app/Dtos/AttributeDto.php | 2 +- app/Dtos/BannerMediaDto.php | 2 +- app/Dtos/ConditionGroupDto.php | 4 +- app/Dtos/CouponDto.php | 2 +- app/Dtos/MediaAttachmentDto.php | 2 +- app/Dtos/ProductSearchDto.php | 2 +- app/Dtos/ProductSetDto.php | 2 +- app/Dtos/ProductSetUpdateDto.php | 2 +- app/Dtos/ProductsReorderDto.php | 2 +- app/Dtos/UserPreferencesDto.php | 2 +- app/Enums/ExceptionsEnums/Exceptions.php | 2 +- app/Exceptions/AuthException.php | 2 +- app/Exceptions/DiscountException.php | 2 +- app/Exceptions/Error.php | 2 +- app/Exceptions/Handler.php | 2 +- app/Exceptions/ItemException.php | 2 +- app/Exceptions/MediaCriticalException.php | 2 +- app/Exceptions/MediaException.php | 2 +- app/Exceptions/OrderException.php | 2 +- app/Exceptions/PackageAuthException.php | 2 +- app/Exceptions/RoleException.php | 2 +- app/Exceptions/StoreException.php | 2 +- app/Exceptions/WebHookCreatorException.php | 2 +- app/Exceptions/WebHookEventException.php | 2 +- app/Http/Controllers/AttributeController.php | 6 +-- .../Controllers/AttributeOptionController.php | 6 +-- app/Http/Controllers/AuthController.php | 20 +++++----- app/Http/Controllers/BannerController.php | 10 ++--- app/Http/Controllers/FavouriteController.php | 4 +- app/Http/Controllers/FilterController.php | 2 +- .../Controllers/GoogleCategoryController.php | 2 +- app/Http/Controllers/ItemController.php | 4 +- app/Http/Controllers/MetadataController.php | 8 ++-- app/Http/Controllers/OrderController.php | 6 +-- .../Controllers/PackageTemplateController.php | 8 ++-- .../Controllers/PaymentMethodController.php | 2 +- app/Http/Controllers/SchemaController.php | 4 +- app/Http/Controllers/StatusController.php | 8 ++-- app/Http/Controllers/UserController.php | 4 +- app/Http/Requests/AppStoreRequest.php | 2 +- app/Http/Requests/AttributeOptionRequest.php | 2 +- app/Http/Requests/AttributeStoreRequest.php | 2 +- app/Http/Requests/BannerStoreRequest.php | 2 +- app/Http/Requests/OrderCreateRequest.php | 2 +- .../Requests/PackageTemplateCreateRequest.php | 2 +- app/Http/Requests/RoleStoreRequest.php | 2 +- app/Http/Requests/SaleCreateRequest.php | 34 ++++++++--------- app/Http/Requests/SchemaStoreRequest.php | 2 +- app/Http/Requests/StatusCreateRequest.php | 2 +- app/Http/Resources/OrderProductResource.php | 2 +- app/Http/Resources/ProductResource.php | 4 +- app/Models/App.php | 2 +- app/Models/Discount.php | 4 +- app/Models/DiscountCondition.php | 10 ++--- app/Models/Product.php | 2 +- app/Payments/PayU.php | 2 +- app/Policies/WebHookPolicy.php | 2 +- app/Services/AppService.php | 2 +- app/Services/AttributeService.php | 2 +- app/Services/AuthService.php | 6 +-- app/Services/ConsentService.php | 2 +- .../Contracts/DiscountServiceContract.php | 4 +- .../Contracts/ProductSetServiceContract.php | 2 +- .../Contracts/SavedAddressServiceContract.php | 4 +- app/Services/DiscountService.php | 28 +++++++------- app/Services/ItemService.php | 2 +- app/Services/OrderService.php | 8 ++-- app/Services/PackageTemplateService.php | 2 +- app/Services/ProductSetService.php | 10 ++--- app/Services/SavedAddressService.php | 2 +- app/Services/SeoMetadataService.php | 2 +- app/Services/ShippingTimeDateService.php | 2 +- app/Services/StatusService.php | 2 +- config/view.php | 2 +- ..._08_16_113956_create_permission_tables.php | 4 +- ...02_083134_insert_products_seo_metadata.php | 4 +- ...11_17_072028_insert_pages_seo_metadata.php | 2 +- ...20011_insert_product_sets_seo_metadata.php | 2 +- ..._03_082833_add_summary_to_orders_table.php | 2 +- ..._11_102504_add_quantity_to_items_table.php | 2 +- ...22_02_25_124028_change_discounts_table.php | 4 +- ...20818_add_base_price_to_order_products.php | 8 ++-- database/seeders/DiscountSeeder.php | 2 +- database/seeders/OrderSeeder.php | 4 +- pint.json | 25 ++++++++++++ public/index.php | 2 +- routes/attribute.php | 2 +- .../Controllers/RedirectController.php | 4 +- tests/Feature/Attributes/AttributeTest.php | 28 +++++++------- tests/Feature/AuthTest.php | 20 +++++----- tests/Feature/BannerTest.php | 6 +-- tests/Feature/CartTest.php | 28 +++++++------- tests/Feature/CategoryTest.php | 2 +- tests/Feature/DepositsTest.php | 8 ++-- .../Feature/Discounts/DiscountSearchTest.php | 2 +- tests/Feature/Discounts/DiscountTest.php | 6 +-- tests/Feature/MetadataTest.php | 26 ++++++------- tests/Feature/OrderCreateTest.php | 2 +- tests/Feature/OrderDocumentTest.php | 8 ++-- tests/Feature/OrderProductTest.php | 4 +- tests/Feature/OrderUpdateTest.php | 14 +++---- tests/Feature/PageTest.php | 2 +- tests/Feature/PerformanceTest.php | 2 +- tests/Feature/ProductAvailabilityTest.php | 4 +- tests/Feature/ProductSearchDatabaseTest.php | 38 +++++++++---------- tests/Feature/ProductSetCreateTest.php | 2 +- tests/Feature/ProductSetOtherTest.php | 12 +++--- tests/Feature/ProductSetUpdateTest.php | 2 +- tests/Feature/Products/ProductSortTest.php | 2 +- tests/Feature/ProviderTest.php | 12 +++--- tests/Feature/ShippingMethodTest.php | 2 +- tests/Feature/UserTest.php | 2 +- tests/Traits/CreateShippingMethod.php | 2 +- tests/Unit/AnalyticsServiceTest.php | 2 +- tests/Unit/DiscountApplyTest.php | 16 ++++---- tests/Unit/DiscountConditionsCheckTest.php | 8 ++-- tests/Unit/ProductServiceTest.php | 2 +- tests/Unit/ResetTokenMailTest.php | 2 +- tests/Unit/Rules/AttributeSearchTest.php | 2 +- tests/Unit/UndotParamsTest.php | 4 +- tests/Unit/UrlServiceTest.php | 6 +-- 125 files changed, 345 insertions(+), 320 deletions(-) diff --git a/app/Casts/MetadataValue.php b/app/Casts/MetadataValue.php index 975107129..8be26c6ec 100644 --- a/app/Casts/MetadataValue.php +++ b/app/Casts/MetadataValue.php @@ -19,7 +19,7 @@ public function get($model, string $key, $value, array $attributes): mixed return match ($model->value_type->value) { MetadataType::BOOLEAN => (bool) $value, MetadataType::NUMBER => (float) $value, - default => $value + default => $value, }; } diff --git a/app/Criteria/ProductAttributeSearch.php b/app/Criteria/ProductAttributeSearch.php index c3af2d7c7..a80280ca8 100644 --- a/app/Criteria/ProductAttributeSearch.php +++ b/app/Criteria/ProductAttributeSearch.php @@ -22,7 +22,7 @@ public function query(Builder $query): Builder $query ->from('product_attribute_attribute_option') ->whereRaw( - '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`' + '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`', ); if (is_array($value)) { @@ -30,7 +30,7 @@ public function query(Builder $query): Builder 'attribute_options', 'product_attribute_attribute_option.attribute_option_id', '=', - 'attribute_options.id' + 'attribute_options.id', ); $key = is_numeric(Arr::first($value)) ? diff --git a/app/Criteria/ProductNotAttributeSearch.php b/app/Criteria/ProductNotAttributeSearch.php index f84a7d0f9..fee96caa9 100644 --- a/app/Criteria/ProductNotAttributeSearch.php +++ b/app/Criteria/ProductNotAttributeSearch.php @@ -22,7 +22,7 @@ public function query(Builder $query): Builder $query ->from('product_attribute_attribute_option') ->whereRaw( - '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`' + '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`', ); if (is_array($value)) { @@ -30,7 +30,7 @@ public function query(Builder $query): Builder 'attribute_options', 'product_attribute_attribute_option.attribute_option_id', '=', - 'attribute_options.id' + 'attribute_options.id', ); $key = is_numeric(Arr::first($value)) ? diff --git a/app/Criteria/WhereHasBuyer.php b/app/Criteria/WhereHasBuyer.php index d758490fb..1093f98ba 100644 --- a/app/Criteria/WhereHasBuyer.php +++ b/app/Criteria/WhereHasBuyer.php @@ -16,13 +16,13 @@ public function query(Builder $query): Builder fn (Builder $query) => $query ->whereDoesntHave( 'status', - fn (Builder $query) => $query->where('cancel', '!=', false) + fn (Builder $query) => $query->where('cancel', '!=', false), ) ->whereHasMorph( 'buyer', $this->key === 'user' ? [User::class] : [App::class], fn (Builder $query) => $query->where('id', $this->value), - ) + ), ); } } diff --git a/app/Dtos/AttributeDto.php b/app/Dtos/AttributeDto.php index 552a1e023..29a14600b 100644 --- a/app/Dtos/AttributeDto.php +++ b/app/Dtos/AttributeDto.php @@ -26,7 +26,7 @@ public function __construct( ) {} public static function instantiateFromRequest( - AttributeStoreRequest|AttributeUpdateRequest|FormRequest $request + AttributeStoreRequest|AttributeUpdateRequest|FormRequest $request, ): self { return new self( id: $request->input('id', new Missing()), diff --git a/app/Dtos/BannerMediaDto.php b/app/Dtos/BannerMediaDto.php index 82e02b551..938de621f 100644 --- a/app/Dtos/BannerMediaDto.php +++ b/app/Dtos/BannerMediaDto.php @@ -22,7 +22,7 @@ public static function fromDataArray(array $data): self title: $data['title'] ?? null, subtitle: $data['subtitle'] ?? null, media: Collection::make($responsiveMedia) - ->map(fn ($media) => ResponsiveMediaDto::fromDataArray($media)) + ->map(fn ($media) => ResponsiveMediaDto::fromDataArray($media)), ); } diff --git a/app/Dtos/ConditionGroupDto.php b/app/Dtos/ConditionGroupDto.php index bb8b5151d..65056beeb 100644 --- a/app/Dtos/ConditionGroupDto.php +++ b/app/Dtos/ConditionGroupDto.php @@ -13,7 +13,7 @@ class ConditionGroupDto extends Dto public static function fromArray(array $array): self { return new self( - conditions: self::transformArrayToConditionDtos($array) + conditions: self::transformArrayToConditionDtos($array), ); } @@ -39,7 +39,7 @@ private static function transformArrayToConditionDtos(array $conditions): array ConditionType::WEEKDAY_IN => WeekDayInConditionDto::fromArray($condition), ConditionType::CART_LENGTH => CartLengthConditionDto::fromArray($condition), ConditionType::COUPONS_COUNT => CouponsCountConditionDto::fromArray($condition), - default => throw new Exception('Unknown condition type.') + default => throw new Exception('Unknown condition type.'), }; } diff --git a/app/Dtos/CouponDto.php b/app/Dtos/CouponDto.php index 0204f50e2..879b8f850 100644 --- a/app/Dtos/CouponDto.php +++ b/app/Dtos/CouponDto.php @@ -19,7 +19,7 @@ final class CouponDto extends SaleDto implements InstantiateFromRequest protected array|Missing $metadata; public static function instantiateFromRequest( - CouponCreateRequest|CouponUpdateRequest|FormRequest|SaleCreateRequest|StatusUpdateRequest $request + CouponCreateRequest|CouponUpdateRequest|FormRequest|SaleCreateRequest|StatusUpdateRequest $request, ): self { return new self( code: $request->input('code', new Missing()), diff --git a/app/Dtos/MediaAttachmentDto.php b/app/Dtos/MediaAttachmentDto.php index e4d1509c1..f8cf8f946 100644 --- a/app/Dtos/MediaAttachmentDto.php +++ b/app/Dtos/MediaAttachmentDto.php @@ -37,7 +37,7 @@ public static function instantiateFromRequest(FormRequest $request): self name: $request->input('name'), type: $type, visibility: $visibility, - description: $request->input('description') ?? new Missing() + description: $request->input('description') ?? new Missing(), ); } } diff --git a/app/Dtos/ProductSearchDto.php b/app/Dtos/ProductSearchDto.php index c6a280879..f9fffbb97 100644 --- a/app/Dtos/ProductSearchDto.php +++ b/app/Dtos/ProductSearchDto.php @@ -66,7 +66,7 @@ public static function instantiateFromRequest(FormRequest|ProductIndexRequest $r metadata: self::array('metadata', $request), metadata_private: self::array('metadata_private', $request), price_min: $request->input('price.min', new Missing()), - price_max: $request->input('price.max', new Missing()) + price_max: $request->input('price.max', new Missing()), ); } diff --git a/app/Dtos/ProductSetDto.php b/app/Dtos/ProductSetDto.php index d14f75d9d..2e1988741 100644 --- a/app/Dtos/ProductSetDto.php +++ b/app/Dtos/ProductSetDto.php @@ -31,7 +31,7 @@ public function __construct( * @throws DtoException */ public static function instantiateFromRequest( - FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request + FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request, ): self { return new self( id: $request->input('id') ?? new Missing(), diff --git a/app/Dtos/ProductSetUpdateDto.php b/app/Dtos/ProductSetUpdateDto.php index ce9ac8222..b61037579 100644 --- a/app/Dtos/ProductSetUpdateDto.php +++ b/app/Dtos/ProductSetUpdateDto.php @@ -23,7 +23,7 @@ class ProductSetUpdateDto extends Dto implements InstantiateFromRequest private array|Missing|null $attributes_ids; public static function instantiateFromRequest( - FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request + FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request, ): self { return new self( name: $request->input('name', new Missing()), diff --git a/app/Dtos/ProductsReorderDto.php b/app/Dtos/ProductsReorderDto.php index d6c975dc1..4ed9605d0 100644 --- a/app/Dtos/ProductsReorderDto.php +++ b/app/Dtos/ProductsReorderDto.php @@ -12,7 +12,7 @@ final class ProductsReorderDto extends Dto protected array|Missing $products; public static function instantiateFromRequest( - FormRequest|ProductSetProductReorderRequest $request + FormRequest|ProductSetProductReorderRequest $request, ): self { return new self( products: $request->input('products', new Missing()), diff --git a/app/Dtos/UserPreferencesDto.php b/app/Dtos/UserPreferencesDto.php index d595e33b7..44365eca7 100644 --- a/app/Dtos/UserPreferencesDto.php +++ b/app/Dtos/UserPreferencesDto.php @@ -24,7 +24,7 @@ public static function instantiateFromRequest(Request $request): self new_localization_login_alert: $request ->input('preferences.new_localization_login_alert', new Missing()), recovery_code_changed_alert: $request - ->input('preferences.recovery_code_changed_alert', new Missing()) + ->input('preferences.recovery_code_changed_alert', new Missing()), ); } diff --git a/app/Enums/ExceptionsEnums/Exceptions.php b/app/Enums/ExceptionsEnums/Exceptions.php index e7fe1359d..ecc3fa39c 100644 --- a/app/Enums/ExceptionsEnums/Exceptions.php +++ b/app/Enums/ExceptionsEnums/Exceptions.php @@ -143,7 +143,7 @@ public static function getCode(string $value): int self::SERVER_ERROR, self::SERVER_ORDER_STATUSES_NOT_CONFIGURED, self::SERVER_PAYMENT_MICROSERVICE_ERROR => 500, - default => 422 + default => 422, }; } } diff --git a/app/Exceptions/AuthException.php b/app/Exceptions/AuthException.php index 57aa4d8b5..89d6f72bc 100644 --- a/app/Exceptions/AuthException.php +++ b/app/Exceptions/AuthException.php @@ -10,7 +10,7 @@ public function __construct( string $message = '', int $code = 0, ?Throwable $previous = null, - bool $simpleLogs = false + bool $simpleLogs = false, ) { parent::__construct($message, $code, $previous, $simpleLogs); } diff --git a/app/Exceptions/DiscountException.php b/app/Exceptions/DiscountException.php index d7a750bea..586376df4 100644 --- a/app/Exceptions/DiscountException.php +++ b/app/Exceptions/DiscountException.php @@ -9,7 +9,7 @@ class DiscountException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/Error.php b/app/Exceptions/Error.php index 9b20bda56..ce90841b4 100644 --- a/app/Exceptions/Error.php +++ b/app/Exceptions/Error.php @@ -12,7 +12,7 @@ public function __construct( public int $code = 500, public string $key = 'INTERNAL_SERVER_ERROR', public array $errors = [], - public array $stack = [] + public array $stack = [], ) {} /** diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index a0118dbd1..21e06d06c 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -218,7 +218,7 @@ private function createValidationAttributeData(string $key, array $data): array ValidationError::GTE => [ 'field' => $data[0], ], - default => [] + default => [], }; } } diff --git a/app/Exceptions/ItemException.php b/app/Exceptions/ItemException.php index 9a408b883..5b3fa5d8b 100644 --- a/app/Exceptions/ItemException.php +++ b/app/Exceptions/ItemException.php @@ -9,7 +9,7 @@ class ItemException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/MediaCriticalException.php b/app/Exceptions/MediaCriticalException.php index 37d1155b0..974855eba 100644 --- a/app/Exceptions/MediaCriticalException.php +++ b/app/Exceptions/MediaCriticalException.php @@ -9,7 +9,7 @@ class MediaCriticalException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/MediaException.php b/app/Exceptions/MediaException.php index c770a3a1f..f5e09297a 100644 --- a/app/Exceptions/MediaException.php +++ b/app/Exceptions/MediaException.php @@ -9,7 +9,7 @@ class MediaException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/OrderException.php b/app/Exceptions/OrderException.php index c158160a8..768ec35a4 100644 --- a/app/Exceptions/OrderException.php +++ b/app/Exceptions/OrderException.php @@ -9,7 +9,7 @@ class OrderException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/PackageAuthException.php b/app/Exceptions/PackageAuthException.php index 512b9d02c..d06880573 100644 --- a/app/Exceptions/PackageAuthException.php +++ b/app/Exceptions/PackageAuthException.php @@ -9,7 +9,7 @@ class PackageAuthException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/RoleException.php b/app/Exceptions/RoleException.php index d4c89e210..533f18665 100644 --- a/app/Exceptions/RoleException.php +++ b/app/Exceptions/RoleException.php @@ -9,7 +9,7 @@ class RoleException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/StoreException.php b/app/Exceptions/StoreException.php index 812ebf087..40ded497a 100644 --- a/app/Exceptions/StoreException.php +++ b/app/Exceptions/StoreException.php @@ -32,7 +32,7 @@ public function logException(): void . '(code: ' . $this->getCode() . '): ' . $this->getMessage() . ' at ' . $this->getFile() - . ':(' . $this->getLine() . ')' + . ':(' . $this->getLine() . ')', ); } diff --git a/app/Exceptions/WebHookCreatorException.php b/app/Exceptions/WebHookCreatorException.php index 3a9533a90..010d1b3ae 100644 --- a/app/Exceptions/WebHookCreatorException.php +++ b/app/Exceptions/WebHookCreatorException.php @@ -9,7 +9,7 @@ class WebHookCreatorException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/WebHookEventException.php b/app/Exceptions/WebHookEventException.php index 3c8cd29bd..58ca19a1b 100644 --- a/app/Exceptions/WebHookEventException.php +++ b/app/Exceptions/WebHookEventException.php @@ -9,7 +9,7 @@ class WebHookEventException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Http/Controllers/AttributeController.php b/app/Http/Controllers/AttributeController.php index 9835d59cd..c4db2a9fa 100644 --- a/app/Http/Controllers/AttributeController.php +++ b/app/Http/Controllers/AttributeController.php @@ -30,7 +30,7 @@ public function index(AttributeIndexRequest $request): JsonResource ->with(['metadata', 'metadataPrivate']); return AttributeResource::collection( - $query->paginate(Config::get('pagination.per_page')) + $query->paginate(Config::get('pagination.per_page')), ); } @@ -42,7 +42,7 @@ public function show(Attribute $attribute): JsonResource public function store(AttributeStoreRequest $request): JsonResource { $attribute = $this->attributeService->create( - AttributeDto::instantiateFromRequest($request) + AttributeDto::instantiateFromRequest($request), ); return AttributeResource::make($attribute); @@ -52,7 +52,7 @@ public function update(Attribute $attribute, AttributeUpdateRequest $request): J { $attribute = $this->attributeService->update( $attribute, - AttributeDto::instantiateFromRequest($request) + AttributeDto::instantiateFromRequest($request), ); return AttributeResource::make($attribute); diff --git a/app/Http/Controllers/AttributeOptionController.php b/app/Http/Controllers/AttributeOptionController.php index 82896a23b..1c42ad700 100644 --- a/app/Http/Controllers/AttributeOptionController.php +++ b/app/Http/Controllers/AttributeOptionController.php @@ -34,7 +34,7 @@ public function index(AttributeOptionIndexRequest $request, Attribute $attribute ->with(['metadata', 'metadataPrivate']); return AttributeOptionResource::collection( - $query->paginate(Config::get('pagination.per_page')) + $query->paginate(Config::get('pagination.per_page')), ); } @@ -42,7 +42,7 @@ public function store(Attribute $attribute, AttributeOptionRequest $request): Js { $attributeOption = $this->attributeOptionService->create( $attribute->getKey(), - AttributeOptionDto::instantiateFromRequest($request) + AttributeOptionDto::instantiateFromRequest($request), ); return AttributeOptionResource::make($attributeOption); @@ -56,7 +56,7 @@ public function update(Attribute $attribute, AttributeOption $option, AttributeO $attributeOption = $this->attributeOptionService->updateOrCreate( $attribute->getKey(), - AttributeOptionDto::instantiateFromRequest($request) + AttributeOptionDto::instantiateFromRequest($request), ); return AttributeOptionResource::make($attributeOption); diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index e94c45b96..2ef367f4a 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -91,7 +91,7 @@ public function showResetPasswordForm(?string $token = null, ?string $email = nu { $user = $this->authService->showResetPasswordForm( $email, - $token + $token, ); return UserResource::make($user); @@ -102,7 +102,7 @@ public function saveResetPassword(PasswordResetSaveRequest $request): JsonRespon $this->authService->saveResetPassword( $request->input('email'), $request->input('token'), - $request->input('password') + $request->input('password'), ); return Response::json(null, JsonResponse::HTTP_NO_CONTENT); @@ -115,7 +115,7 @@ public function changePassword(PasswordChangeRequest $request): JsonResponse $this->authService->changePassword( $user, $request->input('password'), - $request->input('password_new') + $request->input('password_new'), ); return Response::json(null, JsonResponse::HTTP_NO_CONTENT); @@ -159,7 +159,7 @@ public function setupTFA(TFASetupRequest $request): JsonResource public function confirmTFA(TFAConfirmRequest $request): JsonResource { return TFARecoveryCodesResource::make( - $this->authService->confirmTFA(TFAConfirmDto::instantiateFromRequest($request)) + $this->authService->confirmTFA(TFAConfirmDto::instantiateFromRequest($request)), ); } @@ -195,33 +195,33 @@ public function storeSavedAddress(SavedAddressStoreRequest $request, int $type): { $this->savedAddresService->storeAddress( SavedAddressDto::instantiateFromRequest($request), - $type + $type, ); return SavedAddressResource::collection( SavedAddress::where([ 'user_id' => Auth::id(), 'type' => $type, - ])->get() + ])->get(), ); } public function updateSavedAddress( SavedAddressUpdateRequest $request, SavedAddress $address, - int $type + int $type, ): JsonResource { $this->savedAddresService->updateAddress( $address, SavedAddressDto::instantiateFromRequest($request), - $type + $type, ); return SavedAddressResource::collection( SavedAddress::where([ 'user_id' => Auth::id(), 'type' => $type, - ])->get() + ])->get(), ); } @@ -233,7 +233,7 @@ public function deleteSavedAddress(SavedAddress $address, int $type): JsonResour SavedAddress::where([ 'user_id' => Auth::id(), 'type' => $type, - ])->get() + ])->get(), ); } diff --git a/app/Http/Controllers/BannerController.php b/app/Http/Controllers/BannerController.php index fb1147fea..5b7f86988 100644 --- a/app/Http/Controllers/BannerController.php +++ b/app/Http/Controllers/BannerController.php @@ -24,7 +24,7 @@ public function index(BannerIndexRequest $request): JsonResource ->with(['bannerMedia', 'bannerMedia.media', 'metadata', 'metadataPrivate']); return BannerResource::collection( - $query->paginate(Config::get('pagination.per_page')) + $query->paginate(Config::get('pagination.per_page')), ); } @@ -39,8 +39,8 @@ public function store(BannerStoreRequest $request): JsonResource { return BannerResource::make( $this->bannerService->create( - BannerDto::instantiateFromRequest($request) - ) + BannerDto::instantiateFromRequest($request), + ), ); } @@ -49,8 +49,8 @@ public function update(Banner $banner, BannerUpdateRequest $request): JsonResour return BannerResource::make( $this->bannerService->update( $banner, - BannerDto::instantiateFromRequest($request) - ) + BannerDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/FavouriteController.php b/app/Http/Controllers/FavouriteController.php index 068d936c3..06a217926 100644 --- a/app/Http/Controllers/FavouriteController.php +++ b/app/Http/Controllers/FavouriteController.php @@ -22,8 +22,8 @@ public function store(FavouriteProductSetStoreRequest $request): JsonResource { return FavouriteProductSetResource::make( $this->favouriteService->storeFavouriteProductSet( - FavouriteProductSetDto::instantiateFromRequest($request) - ) + FavouriteProductSetDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/FilterController.php b/app/Http/Controllers/FilterController.php index 229934f09..4b2a770bd 100644 --- a/app/Http/Controllers/FilterController.php +++ b/app/Http/Controllers/FilterController.php @@ -23,7 +23,7 @@ public function indexBySetsIds(FilterIndexRequest $request): JsonResource ) ->orWhere('global', true)->with('options') ->orderBy('order') - ->get() + ->get(), ); } } diff --git a/app/Http/Controllers/GoogleCategoryController.php b/app/Http/Controllers/GoogleCategoryController.php index 840eea629..9c3501ca2 100644 --- a/app/Http/Controllers/GoogleCategoryController.php +++ b/app/Http/Controllers/GoogleCategoryController.php @@ -12,7 +12,7 @@ class GoogleCategoryController extends Controller { public function __construct( - private readonly GoogleCategoryServiceContract $categoryService + private readonly GoogleCategoryServiceContract $categoryService, ) {} public function index(string $lang): JsonResource diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index dcab9f87f..156ddc179 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -44,7 +44,7 @@ public function show(Item $item): JsonResource public function store(ItemCreateRequest $request): JsonResource { $item = $this->itemService->store( - ItemDto::instantiateFromRequest($request) + ItemDto::instantiateFromRequest($request), ); return ItemResource::make($item); @@ -54,7 +54,7 @@ public function update(Item $item, ItemUpdateRequest $request): JsonResource { $item = $this->itemService->update( $item, - ItemDto::instantiateFromRequest($request) + ItemDto::instantiateFromRequest($request), ); return ItemResource::make($item); diff --git a/app/Http/Controllers/MetadataController.php b/app/Http/Controllers/MetadataController.php index c3c9ee810..a1fbf921e 100644 --- a/app/Http/Controllers/MetadataController.php +++ b/app/Http/Controllers/MetadataController.php @@ -35,7 +35,7 @@ public function updateOrCreate(int|string $modelId, Request $request): JsonResou $this->metadataService->updateOrCreate( $model, - $dto + $dto, ); } @@ -54,8 +54,8 @@ public function updateOrCreateLoggedMyPersonal(Request $request): JsonResource { return MetadataResource::make( $this->metadataService->updateOrCreateMyPersonal( - MetadataPersonalListDto::instantiateFromRequest($request) - ) + MetadataPersonalListDto::instantiateFromRequest($request), + ), ); } @@ -65,7 +65,7 @@ public function updateOrCreateUserPersonal(string $modelId, Request $request): J $this->metadataService->updateOrCreateUserPersonal( MetadataPersonalListDto::instantiateFromRequest($request), $modelId, - ) + ), ); } } diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 9c25e19ff..6554d26df 100644 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -161,7 +161,7 @@ public function indexUserOrder(OrderIndexRequest $request): JsonResource Gate::inspect('indexUserOrder', [Order::class]); return OrderResource::collection( - $this->orderService->indexUserOrder(OrderIndexDto::instantiateFromRequest($request)) + $this->orderService->indexUserOrder(OrderIndexDto::instantiateFromRequest($request)), ); } @@ -175,7 +175,7 @@ public function showUserOrder(Order $order): JsonResource public function shippingLists(Order $order, OrderShippingListRequest $request): JsonResource { return OrderResource::make( - $this->orderService->shippingList($order, $request->package_template_id) + $this->orderService->shippingList($order, $request->package_template_id), ); } @@ -236,7 +236,7 @@ public function updateOrderProduct( public function myOrderProducts(OrderProductSearchRequest $request): JsonResource { return OrderProductResourcePublic::collection( - $this->orderService->indexMyOrderProducts(OrderProductSearchDto::instantiateFromRequest($request)) + $this->orderService->indexMyOrderProducts(OrderProductSearchDto::instantiateFromRequest($request)), ); } diff --git a/app/Http/Controllers/PackageTemplateController.php b/app/Http/Controllers/PackageTemplateController.php index 7142e4f98..709ab331a 100644 --- a/app/Http/Controllers/PackageTemplateController.php +++ b/app/Http/Controllers/PackageTemplateController.php @@ -29,8 +29,8 @@ public function store(PackageTemplateCreateRequest $request): JsonResource { return PackageTemplateResource::make( $this->packageTemplateService->store( - PackageTemplateDto::instantiateFromRequest($request) - ) + PackageTemplateDto::instantiateFromRequest($request), + ), ); } @@ -39,8 +39,8 @@ public function update(PackageTemplate $package, PackageTemplateUpdateRequest $r return PackageTemplateResource::make( $this->packageTemplateService->update( $package, - PackageTemplateDto::instantiateFromRequest($request) - ) + PackageTemplateDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/PaymentMethodController.php b/app/Http/Controllers/PaymentMethodController.php index b52022334..e9a8a9417 100644 --- a/app/Http/Controllers/PaymentMethodController.php +++ b/app/Http/Controllers/PaymentMethodController.php @@ -24,7 +24,7 @@ public function __construct( public function index(PaymentMethodIndexRequest $request): JsonResource { return PaymentMethodResource::collection( - $this->paymentMethodService->index(PaymentMethodIndexDto::instantiateFromRequest($request)) + $this->paymentMethodService->index(PaymentMethodIndexDto::instantiateFromRequest($request)), ); } diff --git a/app/Http/Controllers/SchemaController.php b/app/Http/Controllers/SchemaController.php index 025ce08a7..ce68b02ed 100644 --- a/app/Http/Controllers/SchemaController.php +++ b/app/Http/Controllers/SchemaController.php @@ -33,7 +33,7 @@ public function index(IndexSchemaRequest $request): JsonResource public function store(SchemaStoreRequest $request): JsonResource { return SchemaResource::make($this->schemaService->store( - SchemaDto::instantiateFromRequest($request) + SchemaDto::instantiateFromRequest($request), )); } @@ -46,7 +46,7 @@ public function update(SchemaUpdateRequest $request, Schema $schema): JsonResour { return SchemaResource::make($this->schemaService->update( $schema, - SchemaDto::instantiateFromRequest($request) + SchemaDto::instantiateFromRequest($request), )); } diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 9e7f774ac..6fe86ecbd 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -27,14 +27,14 @@ public function index(StatusIndexRequest $request): JsonResource ->with(['metadata']); return StatusResource::collection( - $statuses->orderBy('order')->get() + $statuses->orderBy('order')->get(), ); } public function store(StatusCreateRequest $request): JsonResource { return StatusResource::make( - $this->statusService->store(StatusDto::instantiateFromRequest($request)) + $this->statusService->store(StatusDto::instantiateFromRequest($request)), ); } @@ -43,8 +43,8 @@ public function update(Status $status, StatusUpdateRequest $request): JsonResour return StatusResource::make( $this->statusService->update( $status, - StatusDto::instantiateFromRequest($request) - ) + StatusDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 6f1b1b51d..6f5a8cea6 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -55,7 +55,7 @@ public function show(User $user): JsonResource public function store(UserCreateRequest $request): JsonResource { $user = $this->userService->create( - UserCreateDto::instantiateFromRequest($request) + UserCreateDto::instantiateFromRequest($request), ); return UserResource::make($user); @@ -65,7 +65,7 @@ public function update(User $user, UserUpdateRequest $request): JsonResource { $resultUser = $this->userService->update( $user, - UserDto::instantiateFromRequest($request) + UserDto::instantiateFromRequest($request), ); return UserResource::make($resultUser); diff --git a/app/Http/Requests/AppStoreRequest.php b/app/Http/Requests/AppStoreRequest.php index 8bd9393b1..17d222d0f 100644 --- a/app/Http/Requests/AppStoreRequest.php +++ b/app/Http/Requests/AppStoreRequest.php @@ -25,7 +25,7 @@ public function rules(): array 'allowed_permissions.*' => ['string'], 'public_app_permissions' => ['present', 'array'], 'public_app_permissions.*' => ['string'], - ] + ], ); } } diff --git a/app/Http/Requests/AttributeOptionRequest.php b/app/Http/Requests/AttributeOptionRequest.php index ec5873545..f575a74dc 100644 --- a/app/Http/Requests/AttributeOptionRequest.php +++ b/app/Http/Requests/AttributeOptionRequest.php @@ -28,7 +28,7 @@ public function rules(): array 'name' => [$nameRule, 'string', 'max:255'], 'value_number' => ['nullable', 'numeric', 'regex:/^\d{1,6}(\.\d{1,2}|)$/'], 'value_date' => ['nullable', 'date'], - ] + ], ); } } diff --git a/app/Http/Requests/AttributeStoreRequest.php b/app/Http/Requests/AttributeStoreRequest.php index 82d585b74..5cd115529 100644 --- a/app/Http/Requests/AttributeStoreRequest.php +++ b/app/Http/Requests/AttributeStoreRequest.php @@ -35,7 +35,7 @@ public function rules(): array 'type' => ['required', new Enum(AttributeType::class)], 'global' => ['required', 'boolean'], 'sortable' => ['required', 'boolean'], - ] + ], ); } } diff --git a/app/Http/Requests/BannerStoreRequest.php b/app/Http/Requests/BannerStoreRequest.php index 9c5ae1173..6183592b4 100644 --- a/app/Http/Requests/BannerStoreRequest.php +++ b/app/Http/Requests/BannerStoreRequest.php @@ -25,7 +25,7 @@ public function rules(): array 'banner_media.*.media' => ['required', 'array'], 'banner_media.*.media.*.min_screen_width' => ['required', 'numeric'], 'banner_media.*.media.*.media' => ['required', 'uuid', 'exists:media,id'], - ] + ], ); } } diff --git a/app/Http/Requests/OrderCreateRequest.php b/app/Http/Requests/OrderCreateRequest.php index d9754c737..fc9f298b8 100644 --- a/app/Http/Requests/OrderCreateRequest.php +++ b/app/Http/Requests/OrderCreateRequest.php @@ -45,7 +45,7 @@ public function rules(): array ], 'invoice_requested' => ['boolean'], - ] + ], ); } } diff --git a/app/Http/Requests/PackageTemplateCreateRequest.php b/app/Http/Requests/PackageTemplateCreateRequest.php index 90438fc4f..73d97125b 100644 --- a/app/Http/Requests/PackageTemplateCreateRequest.php +++ b/app/Http/Requests/PackageTemplateCreateRequest.php @@ -19,7 +19,7 @@ public function rules(): array 'width' => ['required', 'integer'], 'height' => ['required', 'integer'], 'depth' => ['required', 'integer'], - ] + ], ); } } diff --git a/app/Http/Requests/RoleStoreRequest.php b/app/Http/Requests/RoleStoreRequest.php index 86f59b681..3d8a34644 100644 --- a/app/Http/Requests/RoleStoreRequest.php +++ b/app/Http/Requests/RoleStoreRequest.php @@ -19,7 +19,7 @@ public function rules(): array 'is_registration_role' => ['boolean'], 'permissions' => ['array'], 'permissions.*' => ['string'], - ] + ], ); } } diff --git a/app/Http/Requests/SaleCreateRequest.php b/app/Http/Requests/SaleCreateRequest.php index 72d908cb6..e97be9c82 100644 --- a/app/Http/Requests/SaleCreateRequest.php +++ b/app/Http/Requests/SaleCreateRequest.php @@ -71,7 +71,7 @@ function ($input, $item) { ConditionType::MAX_USES, ConditionType::MAX_USES_PER_USER, ]); - } + }, ); $validator->sometimes( @@ -85,7 +85,7 @@ function ($input, $item) { ConditionType::USER_IN, ConditionType::USER_IN_ROLE, ]); - } + }, ); $validator->sometimes( @@ -98,7 +98,7 @@ function ($input, $item) { ConditionType::DATE_BETWEEN, ConditionType::TIME_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -109,7 +109,7 @@ function ($input, $item) { ->in([ ConditionType::ORDER_VALUE, ]); - } + }, ); $validator->sometimes( @@ -120,7 +120,7 @@ function ($input, $item) { ->in([ ConditionType::ORDER_VALUE, ]); - } + }, ); $validator->sometimes( @@ -135,7 +135,7 @@ function ($input, $item) { ->in([ ConditionType::ORDER_VALUE, ]); - } + }, ); $validator->sometimes( @@ -146,7 +146,7 @@ function ($input, $item) { ->in([ ConditionType::TIME_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -157,7 +157,7 @@ function ($input, $item) { ->in([ ConditionType::TIME_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -168,7 +168,7 @@ function ($input, $item) { ->in([ ConditionType::DATE_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -183,7 +183,7 @@ function ($input, $item) { ->in([ ConditionType::DATE_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -194,7 +194,7 @@ function ($input, $item) { ->in([ ConditionType::WEEKDAY_IN, ]); - } + }, ); $validator->sometimes( @@ -205,7 +205,7 @@ function ($input, $item) { ->in([ ConditionType::USER_IN_ROLE, ]); - } + }, ); $validator->sometimes( @@ -216,7 +216,7 @@ function ($input, $item) { ->in([ ConditionType::USER_IN, ]); - } + }, ); $validator->sometimes( @@ -227,7 +227,7 @@ function ($input, $item) { ->in([ ConditionType::PRODUCT_IN, ]); - } + }, ); $validator->sometimes( @@ -238,7 +238,7 @@ function ($input, $item) { ->in([ ConditionType::PRODUCT_IN_SET, ]); - } + }, ); $validator->sometimes( @@ -250,7 +250,7 @@ function ($input, $item) { ConditionType::CART_LENGTH, ConditionType::COUPONS_COUNT, ]); - } + }, ); $validator->sometimes( @@ -266,7 +266,7 @@ function ($input, $item) { ConditionType::CART_LENGTH, ConditionType::COUPONS_COUNT, ]); - } + }, ); } } diff --git a/app/Http/Requests/SchemaStoreRequest.php b/app/Http/Requests/SchemaStoreRequest.php index 2386cd09c..4e83cd18d 100644 --- a/app/Http/Requests/SchemaStoreRequest.php +++ b/app/Http/Requests/SchemaStoreRequest.php @@ -39,7 +39,7 @@ public function rules(): array 'options.*.items' => ['nullable', 'array'], 'options.*.items.*' => ['uuid', 'exists:items,id'], - ] + ], ); } } diff --git a/app/Http/Requests/StatusCreateRequest.php b/app/Http/Requests/StatusCreateRequest.php index 38d5e7e2e..da4a58f83 100644 --- a/app/Http/Requests/StatusCreateRequest.php +++ b/app/Http/Requests/StatusCreateRequest.php @@ -20,7 +20,7 @@ public function rules(): array 'description' => ['string', 'max:255', 'nullable'], 'hidden' => ['boolean'], 'no_notifications' => ['boolean'], - ] + ], ); } } diff --git a/app/Http/Resources/OrderProductResource.php b/app/Http/Resources/OrderProductResource.php index 883a0cca3..7cd80bb31 100644 --- a/app/Http/Resources/OrderProductResource.php +++ b/app/Http/Resources/OrderProductResource.php @@ -26,7 +26,7 @@ public function base(Request $request): array 'sets' => ProductSetResource::collection( Gate::denies('product_sets.show_hidden') ? $this->resource->product->sets->where('public', true) - : $this->resource->product->sets + : $this->resource->product->sets, ), ], ]; diff --git a/app/Http/Resources/ProductResource.php b/app/Http/Resources/ProductResource.php index 91f56ca9c..79b3aa2a2 100644 --- a/app/Http/Resources/ProductResource.php +++ b/app/Http/Resources/ProductResource.php @@ -49,13 +49,13 @@ public function view(Request $request): array { $sets = Gate::denies('product_sets.show_hidden') ? $this->resource->sets->filter( - fn (ProductSet $set) => $set->public === true && $set->public_parent === true + fn (ProductSet $set) => $set->public === true && $set->public_parent === true, ) : $this->resource->sets; $relatedSets = Gate::denies('product_sets.show_hidden') ? $this->resource->relatedSets->filter( - fn (ProductSet $set) => $set->public === true && $set->public_parent === true + fn (ProductSet $set) => $set->public === true && $set->public_parent === true, ) : $this->resource->relatedSets; diff --git a/app/Models/App.php b/app/Models/App.php index 2d3fa8753..6de785c4c 100644 --- a/app/Models/App.php +++ b/app/Models/App.php @@ -108,7 +108,7 @@ public function shippingMethods(): HasMany public function hasRole( array|Collection|int|\Spatie\Permission\Contracts\Role|string $roles, - ?string $guard = null + ?string $guard = null, ): bool { return false; } diff --git a/app/Models/Discount.php b/app/Models/Discount.php index 8ec1e0363..11531c29e 100644 --- a/app/Models/Discount.php +++ b/app/Models/Discount.php @@ -85,7 +85,7 @@ public function products(): MorphToMany return $this->morphedByMany( Product::class, 'model', - 'model_has_discounts' + 'model_has_discounts', )->with(['metadata', 'metadataPrivate', 'attributes', 'media', 'tags']); } @@ -94,7 +94,7 @@ public function productSets(): MorphToMany return $this->morphedByMany( ProductSet::class, 'model', - 'model_has_discounts' + 'model_has_discounts', )->with(['metadata', 'metadataPrivate']); } diff --git a/app/Models/DiscountCondition.php b/app/Models/DiscountCondition.php index e9cf69bf7..11853fe27 100644 --- a/app/Models/DiscountCondition.php +++ b/app/Models/DiscountCondition.php @@ -31,7 +31,7 @@ public function getValueAttribute(string $value): array if ($this->type->is(ConditionType::WEEKDAY_IN)) { $value['weekday'] = array_map( fn (string $key) => (bool) $key, - mb_str_split(sprintf('%07d', decbin($value['weekday']))) + mb_str_split(sprintf('%07d', decbin($value['weekday']))), ); } @@ -57,7 +57,7 @@ public function products(): MorphToMany return $this->morphedByMany( Product::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } @@ -66,7 +66,7 @@ public function productSets(): MorphToMany return $this->morphedByMany( ProductSet::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } @@ -75,7 +75,7 @@ public function users(): MorphToMany return $this->morphedByMany( User::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } @@ -84,7 +84,7 @@ public function roles(): MorphToMany return $this->morphedByMany( Role::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } diff --git a/app/Models/Product.php b/app/Models/Product.php index d1b054867..9a6c82ccd 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -231,7 +231,7 @@ public function allProductSales(Collection $salesWithBlockList): Collection fn (Discount $discount): bool => $discount->code === null && $discount->active && $discount->target_type->is(DiscountTargetType::PRODUCTS) - && $discount->target_is_allow_list + && $discount->target_is_allow_list, ); $salesBlockList = $salesWithBlockList->filter(function ($sale): bool { diff --git a/app/Payments/PayU.php b/app/Payments/PayU.php index e096ee828..c6447b765 100644 --- a/app/Payments/PayU.php +++ b/app/Payments/PayU.php @@ -75,7 +75,7 @@ public static function translateNotification(Request $request): JsonResponse $request->getContent(), $signature['signature'], Config::get('payu.second_key'), - $signature['algorithm'] + $signature['algorithm'], )) { throw new ClientException(Exceptions::CLIENT_UNTRUSTED_NOTIFICATION); } diff --git a/app/Policies/WebHookPolicy.php b/app/Policies/WebHookPolicy.php index c024303b2..d25c22b0b 100644 --- a/app/Policies/WebHookPolicy.php +++ b/app/Policies/WebHookPolicy.php @@ -31,7 +31,7 @@ public function update(App|User $user, WebHook $webHook, array $newWebHook): Res $newWebHook['events'] ?? $webHook->events, $newWebHook['with_issuer'] ?? $webHook->with_issuer, $newWebHook['with_hidden'] ?? $webHook->with_hidden, - $user + $user, ); } diff --git a/app/Services/AppService.php b/app/Services/AppService.php index 4a92f70b1..806b7650f 100644 --- a/app/Services/AppService.php +++ b/app/Services/AppService.php @@ -274,7 +274,7 @@ private function createAppOwnerRole(App $app, Collection $internalPermissions): private function makePermissionsPublic( App $app, Collection $internalPermissions, - Collection $publicPermissions + Collection $publicPermissions, ): void { $publicPermissions = $publicPermissions->map( fn ($permission) => "app.{$app->slug}.{$permission}", diff --git a/app/Services/AttributeService.php b/app/Services/AttributeService.php index ce2efe482..824a103c7 100644 --- a/app/Services/AttributeService.php +++ b/app/Services/AttributeService.php @@ -55,7 +55,7 @@ public function sync(Product $product, array $data): void $product->attributes()->sync($attributes); $product->attributes()->get()->each( - fn (Attribute $attribute) => $attribute->pivot->options()->sync($data[$attribute->getKey()]) + fn (Attribute $attribute) => $attribute->pivot->options()->sync($data[$attribute->getKey()]), ); } diff --git a/app/Services/AuthService.php b/app/Services/AuthService.php index 964eb82ee..edba435ef 100644 --- a/app/Services/AuthService.php +++ b/app/Services/AuthService.php @@ -390,7 +390,7 @@ private function noTFACode(): void Auth::user()->securityCodes()->where('expires_at', '!=', null)->delete(); $code = $this->oneTimeSecurityCodeService->generateOneTimeSecurityCode( Auth::user(), - Config::get('tfa.code_expires_time') + Config::get('tfa.code_expires_time'), ); TfaSecurityCodeEvent::dispatch(Auth::user(), $code); @@ -521,7 +521,7 @@ private function googleTFA(): array $qr_code_url = $google_authenticator->getQRCodeGoogleUrl( $user->email, $secret, - Config::get('app.name') + Config::get('app.name'), ); $user->update([ @@ -543,7 +543,7 @@ private function emailTFA(): array $user->securityCodes()->delete(); $code = $this->oneTimeSecurityCodeService->generateOneTimeSecurityCode( $user, - Config::get('tfa.code_expires_time') + Config::get('tfa.code_expires_time'), ); $user->update([ diff --git a/app/Services/ConsentService.php b/app/Services/ConsentService.php index ca4881897..6cc043b8e 100644 --- a/app/Services/ConsentService.php +++ b/app/Services/ConsentService.php @@ -46,7 +46,7 @@ public function updateUserConsents(?Collection $consents, User $user): void ], [ 'value' => $value, - ] + ], ); }); } diff --git a/app/Services/Contracts/DiscountServiceContract.php b/app/Services/Contracts/DiscountServiceContract.php index ef3032903..54c3c8ed7 100644 --- a/app/Services/Contracts/DiscountServiceContract.php +++ b/app/Services/Contracts/DiscountServiceContract.php @@ -38,7 +38,7 @@ public function destroy(Discount $discount): void; public function checkCondition( DiscountCondition $condition, ?CartOrderDto $dto = null, - float $cartValue = 0 + float $cartValue = 0, ): bool; public function checkConditionGroup(ConditionGroup $group, CartOrderDto $dto, float $cartValue): bool; @@ -48,7 +48,7 @@ public function checkConditionGroups(Discount $discount, CartOrderDto $dto, floa public function applyDiscountOnProduct( Product $product, OrderProductDto $orderProductDto, - Discount $discount + Discount $discount, ): OrderProduct; public function applyDiscountsOnProducts(Collection $products): void; diff --git a/app/Services/Contracts/ProductSetServiceContract.php b/app/Services/Contracts/ProductSetServiceContract.php index df0a098bd..0f4c0c503 100644 --- a/app/Services/Contracts/ProductSetServiceContract.php +++ b/app/Services/Contracts/ProductSetServiceContract.php @@ -25,7 +25,7 @@ public function updateChildren( Collection $children, string $parentId, string $parentSlug, - bool $publicParent + bool $publicParent, ): void; public function delete(ProductSet $set): void; diff --git a/app/Services/Contracts/SavedAddressServiceContract.php b/app/Services/Contracts/SavedAddressServiceContract.php index 25338c026..cbabd8ef1 100644 --- a/app/Services/Contracts/SavedAddressServiceContract.php +++ b/app/Services/Contracts/SavedAddressServiceContract.php @@ -9,13 +9,13 @@ interface SavedAddressServiceContract { public function storeAddress( SavedAddressDto $addressDto, - int $type + int $type, ): ?SavedAddress; public function updateAddress( SavedAddress $address, SavedAddressDto $addressDto, - int $type + int $type, ): SavedAddress; public function deleteSavedAddress(SavedAddress $address): void; diff --git a/app/Services/DiscountService.php b/app/Services/DiscountService.php index 5e0125d66..f27687e67 100644 --- a/app/Services/DiscountService.php +++ b/app/Services/DiscountService.php @@ -214,7 +214,7 @@ public function checkCondition( ConditionType::USER_IN => $this->checkConditionUserIn($condition), ConditionType::PRODUCT_IN_SET => $this->checkConditionProductInSet( $condition, - $dto?->getProductIds() ?? [] + $dto?->getProductIds() ?? [], ), ConditionType::PRODUCT_IN => $this->checkConditionProductIn($condition, $dto?->getProductIds() ?? []), ConditionType::DATE_BETWEEN => $this->checkConditionDateBetween($condition), @@ -361,11 +361,11 @@ public function calcCartDiscounts(CartDto $cart, Collection $products): CartReso if ($discount->code !== null) { $cartResource->coupons->push( - new CouponShortResource($discount->getKey(), $discount->name, $appliedDiscount, $discount->code) + new CouponShortResource($discount->getKey(), $discount->name, $appliedDiscount, $discount->code), ); } else { $cartResource->sales->push( - new SalesShortResource($discount->getKey(), $discount->name, $appliedDiscount) + new SalesShortResource($discount->getKey(), $discount->name, $appliedDiscount), ); } @@ -406,7 +406,7 @@ public function calcProductsListDiscounts(Collection $products): array public function applyDiscountOnProduct( Product $product, OrderProductDto $orderProductDto, - Discount $discount + Discount $discount, ): OrderProduct { $price = $product->price; @@ -518,7 +518,7 @@ public function activeSales(): Collection ->orWhere('type', ConditionType::WEEKDAY_IN); }); }) - ->orWhereDoesntHave('conditionGroups') + ->orWhereDoesntHave('conditionGroups'), ) ->with(['conditionGroups', 'conditionGroups.conditions']) ->get(); @@ -552,7 +552,7 @@ public function checkDiscountHasTimeConditions(Discount $discount): bool ConditionType::DATE_BETWEEN, ConditionType::TIME_BETWEEN, ConditionType::WEEKDAY_IN, - ] + ], )) { return true; } @@ -718,7 +718,7 @@ private function checkDiscountTarget(Discount $discount, CartDto $cart): bool return in_array( $discount->target_type->value, - [DiscountTargetType::ORDER_VALUE, DiscountTargetType::CHEAPEST_PRODUCT] + [DiscountTargetType::ORDER_VALUE, DiscountTargetType::CHEAPEST_PRODUCT], ); } @@ -921,7 +921,7 @@ private function applyDiscountOnOrderShipping(Order $order, Discount $discount): if ( in_array( $order->shipping_method_id, - $discount->shippingMethods->pluck('id')->toArray() + $discount->shippingMethods->pluck('id')->toArray(), ) === $discount->target_is_allow_list ) { $appliedDiscount = $this->calcAppliedDiscount( @@ -1039,12 +1039,12 @@ private function applyDiscountOnCart(Discount $discount, CartDto $cartDto, CartR private function applyDiscountOnCartShipping( Discount $discount, CartDto $cartDto, - CartResource $cartResource + CartResource $cartResource, ): CartResource { if ( in_array( $cartDto->getShippingMethodId(), - $discount->shippingMethods->pluck('id')->toArray() + $discount->shippingMethods->pluck('id')->toArray(), ) === $discount->target_is_allow_list ) { $cartResource->shipping_price -= $this->calcAppliedDiscount( @@ -1215,7 +1215,7 @@ private function checkIsProductInDiscount(string $productId, Discount $discount) return $this->checkIsProductInDiscountProductSets( $productId, $discount->productSets, - $discount->target_is_allow_list + $discount->target_is_allow_list, ); } @@ -1230,7 +1230,7 @@ private function checkIsProductInDiscountProducts(string $productId, Discount $d private function checkIsProductInDiscountProductSets( string $productId, Collection $discountProductSets, - bool $allowList + bool $allowList, ): bool { /** @var Product $product */ $product = Product::query()->where('id', $productId)->firstOrFail(); @@ -1256,7 +1256,7 @@ private function checkIsProductInDiscountProductSets( private function checkProductSetParentInDiscount( ProductSet $productSet, Collection $productSets, - bool $allowList + bool $allowList, ): bool { if ($productSet->parent) { if ($productSets->contains($productSet->parent->id)) { @@ -1369,7 +1369,7 @@ private function checkConditionProductInSet(DiscountCondition $condition, array $result = $this->checkIsProductInDiscountProductSets( $productId, $productSets, - $conditionDto->isIsAllowList() + $conditionDto->isIsAllowList(), ); if ($result === $conditionDto->isIsAllowList()) { diff --git a/app/Services/ItemService.php b/app/Services/ItemService.php index 8f0cb66f6..de6d6d113 100644 --- a/app/Services/ItemService.php +++ b/app/Services/ItemService.php @@ -270,7 +270,7 @@ private function checkProductPurchaseLimit( string $productId, float $limit, array $purchasedProducts, - float $quantity + float $quantity, ): array { $relation = Auth::user() instanceof User ? 'user' : 'app'; if (array_key_exists($productId, $purchasedProducts)) { diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index d5676ef0f..88651858e 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -60,7 +60,7 @@ public function __construct( private ItemServiceContract $itemService, private NameServiceContract $nameService, private MetadataServiceContract $metadataService, - private DepositServiceContract $depositService + private DepositServiceContract $depositService, ) {} public function calcSummary(Order $order): float @@ -411,7 +411,7 @@ public function processOrderProductUrls(OrderProductUpdateDto $dto, OrderProduct public function indexMyOrderProducts(OrderProductSearchDto $dto): LengthAwarePaginator { return OrderProduct::searchByCriteria( - ['user' => Auth::id(), 'paid' => true] + $dto->toArray() + ['user' => Auth::id(), 'paid' => true] + $dto->toArray(), ) ->sort('created_at:desc') ->with(['urls', 'product']) @@ -538,7 +538,7 @@ private function removeItemsFromWarehouse(OrderProduct $orderProduct, array $tem private function resolveShippingAddress( Address|Missing|string|null $shippingPlace, string $shippingType, - Order $order + Order $order, ): ?string { if ($shippingPlace instanceof Missing) { return $order->shipping_address_id; @@ -569,7 +569,7 @@ private function resolveShippingAddress( private function resolveShippingPlace( Address|Missing|string|null $shippingPlace, string $shippingType, - Order $order + Order $order, ): ?string { if ($shippingPlace instanceof Missing) { return $order->shipping_place; diff --git a/app/Services/PackageTemplateService.php b/app/Services/PackageTemplateService.php index 14cc22148..41fcc4718 100644 --- a/app/Services/PackageTemplateService.php +++ b/app/Services/PackageTemplateService.php @@ -11,7 +11,7 @@ class PackageTemplateService implements PackageTemplateServiceContract { public function __construct( - private MetadataServiceContract $metadataService + private MetadataServiceContract $metadataService, ) {} public function store(PackageTemplateDto $dto): PackageTemplate diff --git a/app/Services/ProductSetService.php b/app/Services/ProductSetService.php index f1fbe0ad1..eeed98c6e 100644 --- a/app/Services/ProductSetService.php +++ b/app/Services/ProductSetService.php @@ -129,7 +129,7 @@ public function updateChildren( Collection $children, string $parentId, ?string $parentSlug, - bool $publicParent + bool $publicParent, ): void { $children->each( function ($child, $order) use ($parentId, $parentSlug, $publicParent): void { @@ -143,7 +143,7 @@ function ($child, $order) use ($parentId, $parentSlug, $publicParent): void { $child->children, $child->getKey(), $childSlug, - $publicParent && $child->public + $publicParent && $child->public, ); $child->update([ @@ -240,8 +240,8 @@ public function attach(ProductSet $set, array $productsIds): Collection ProductSearchValueEvent::dispatch( array_merge( $currentProducts->diff($productsIds)->toArray(), - collect($productsIds)->diff($currentProducts)->toArray() - ) + collect($productsIds)->diff($currentProducts)->toArray(), + ), ); return $set->products; @@ -371,7 +371,7 @@ private function assignOrderToNulls(int $highestOrder, Collection $products): vo private function prepareSlug( bool|Missing $isOverridden, Missing|string|null $slugSuffix, - string $parentSlug + string $parentSlug, ): ?string { $slug = $slugSuffix instanceof Missing ? null : $slugSuffix; if (!$isOverridden instanceof Missing && !$isOverridden) { diff --git a/app/Services/SavedAddressService.php b/app/Services/SavedAddressService.php index 968dd4e12..a47377db6 100644 --- a/app/Services/SavedAddressService.php +++ b/app/Services/SavedAddressService.php @@ -48,7 +48,7 @@ public function storeAddress(SavedAddressDto $addressDto, int $type): ?SavedAddr public function updateAddress( SavedAddress $address, SavedAddressDto $addressDto, - int $type + int $type, ): SavedAddress { if (Auth::id() !== $address->user_id) { throw new AuthenticationException(); diff --git a/app/Services/SeoMetadataService.php b/app/Services/SeoMetadataService.php index 6d14e0600..ea515e5d2 100644 --- a/app/Services/SeoMetadataService.php +++ b/app/Services/SeoMetadataService.php @@ -29,7 +29,7 @@ public function createOrUpdate(SeoMetadataDto $dto): SeoMetadata /** @var SeoMetadata $seo */ $seo = SeoMetadata::query()->firstOrCreate( ['global' => true], - $dto->toArray() + $dto->toArray(), ); if (!$seo->wasRecentlyCreated) { diff --git a/app/Services/ShippingTimeDateService.php b/app/Services/ShippingTimeDateService.php index 91cef9e3d..b4f0c723e 100644 --- a/app/Services/ShippingTimeDateService.php +++ b/app/Services/ShippingTimeDateService.php @@ -17,7 +17,7 @@ class ShippingTimeDateService implements ShippingTimeDateServiceContract { public function __construct( private AvailabilityServiceContract $availabilityService, - private DepositServiceContract $depositService + private DepositServiceContract $depositService, ) {} public function stopShippingUnlimitedStockDate(): void diff --git a/app/Services/StatusService.php b/app/Services/StatusService.php index 3d730bd13..ea79af55b 100644 --- a/app/Services/StatusService.php +++ b/app/Services/StatusService.php @@ -13,7 +13,7 @@ class StatusService implements StatusServiceContract { public function __construct( - private MetadataServiceContract $metadataService + private MetadataServiceContract $metadataService, ) {} public function store(StatusDto $dto): Status diff --git a/config/view.php b/config/view.php index b6f3a4c0c..206a8def4 100644 --- a/config/view.php +++ b/config/view.php @@ -29,6 +29,6 @@ 'compiled' => env( 'VIEW_COMPILED_PATH', - realpath(storage_path('framework/views')) + realpath(storage_path('framework/views')), ), ]; diff --git a/database/migrations/2021_08_16_113956_create_permission_tables.php b/database/migrations/2021_08_16_113956_create_permission_tables.php index 02542943e..fca9656e1 100755 --- a/database/migrations/2021_08_16_113956_create_permission_tables.php +++ b/database/migrations/2021_08_16_113956_create_permission_tables.php @@ -50,7 +50,7 @@ public function up(): void $table->primary( ['permission_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_permissions_permission_model_type_primary' + 'model_has_permissions_permission_model_type_primary', ); }); @@ -68,7 +68,7 @@ public function up(): void $table->primary( ['role_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_roles_role_model_type_primary' + 'model_has_roles_role_model_type_primary', ); }); diff --git a/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php b/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php index 8b394b727..2788c5335 100755 --- a/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php +++ b/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php @@ -18,8 +18,8 @@ public function up(): void 'global' => false, 'model_id' => $product->id, 'model_type' => Product::class, - ]) - ) + ]), + ), ); } } diff --git a/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php b/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php index a3d2f98e5..960bfed94 100755 --- a/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php +++ b/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php @@ -16,7 +16,7 @@ public function up(): void 'global' => false, 'model_id' => $page->getKey(), 'model_type' => Page::class, - ]) + ]), )); } } diff --git a/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php b/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php index fc5db913d..a873c7984 100755 --- a/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php +++ b/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php @@ -16,7 +16,7 @@ public function up(): void 'global' => false, 'model_id' => $set->getKey(), 'model_type' => ProductSet::class, - ]) + ]), )); } } diff --git a/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php b/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php index a6a12ea72..8f79e851a 100755 --- a/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php +++ b/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php @@ -23,7 +23,7 @@ public function up(): void fn (Order $order) => $order->update([ 'summary' => $orderService->calcSummary($order), 'paid' => $order->paid_amount >= $orderService->calcSummary($order), - ]) + ]), )); } diff --git a/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php b/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php index 65b72b657..49eaa0f3f 100755 --- a/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php +++ b/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php @@ -16,7 +16,7 @@ public function up(): void Item::chunk(100, fn ($item) => $item->each( fn (Item $item) => $item->update([ 'quantity' => $item->deposits->sum('quantity'), - ]) + ]), )); } diff --git a/database/migrations/2022_02_25_124028_change_discounts_table.php b/database/migrations/2022_02_25_124028_change_discounts_table.php index c7420ec45..b99f651e0 100755 --- a/database/migrations/2022_02_25_124028_change_discounts_table.php +++ b/database/migrations/2022_02_25_124028_change_discounts_table.php @@ -76,7 +76,7 @@ function (Discount $discount): void { } $discount->conditionGroups()->attach($conditionGroup); - } + }, )); Schema::table('discounts', function (Blueprint $table): void { @@ -118,7 +118,7 @@ function (Discount $discount): void { 'expires_at' => $expiresAt, ]); $discount->conditionGroups()->delete(); - } + }, )); Schema::dropIfExists('model_has_discounts'); diff --git a/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php b/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php index 9122f78b8..35472e2d0 100644 --- a/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php +++ b/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php @@ -27,8 +27,8 @@ function (OrderProduct $product): void { 'price' => $product->price + $schemaPrice, 'price_initial' => $product->price_initial + $schemaPrice, ]); - } - ) + }, + ), ); } @@ -40,8 +40,8 @@ public function down(): void fn (OrderProduct $product) => $product->update([ 'price' => $product->base_price, 'price_initial' => $product->base_price_initial, - ]) - ) + ]), + ), ); Schema::table('order_products', function (Blueprint $table): void { diff --git a/database/seeders/DiscountSeeder.php b/database/seeders/DiscountSeeder.php index df0026502..95d7d6f82 100755 --- a/database/seeders/DiscountSeeder.php +++ b/database/seeders/DiscountSeeder.php @@ -34,7 +34,7 @@ public function run(): void [ DiscountTargetType::ORDER_VALUE, DiscountTargetType::SHIPPING_PRICE, - ] + ], ) ->random(); diff --git a/database/seeders/OrderSeeder.php b/database/seeders/OrderSeeder.php index f728866ea..32379339b 100755 --- a/database/seeders/OrderSeeder.php +++ b/database/seeders/OrderSeeder.php @@ -87,7 +87,7 @@ function ($order) use ($shipping_methods, $statuses, $orderService, $digital_met for ($i = 0; $i < mt_rand(0, 5); ++$i) { $order->payments()->save(Payment::factory()->make()); } - } + }, ); } @@ -99,7 +99,7 @@ private function addProductsToOrder(Order $order, bool $digital): void fn ($sequence) => [ 'product_id' => Product::where('shipping_digital', $digital)->inRandomOrder()->first()->getKey(), 'shipping_digital' => $digital, - ] + ], ) ->make(); $order->products()->saveMany($products); diff --git a/pint.json b/pint.json index b7b029c27..20fa157ef 100644 --- a/pint.json +++ b/pint.json @@ -45,6 +45,31 @@ "phpdoc_var_annotation_correct_order": true, "simplified_if_return": true, "use_arrow_functions": true, + "normalize_index_brace": true, + "no_multiline_whitespace_around_double_arrow": true, + "control_structure_braces": true, + "statement_indentation": true, + "indentation_type": true, + "no_whitespace_before_comma_in_array": { + "after_heredoc": true + }, + "no_trailing_comma_in_singleline": { + "elements": [ + "arguments", + "array", + "array_destructuring", + "group_import" + ] + }, + "trailing_comma_in_multiline": { + "after_heredoc": true, + "elements": [ + "arguments", + "arrays", + "match", + "parameters" + ] + }, "phpdoc_line_span": { "const": "single", "method": "multi", diff --git a/public/index.php b/public/index.php index aa17e3ba0..1294666ad 100644 --- a/public/index.php +++ b/public/index.php @@ -61,7 +61,7 @@ $kernel = $app->make(Kernel::class); $response = tap($kernel->handle( - $request = Request::capture() + $request = Request::capture(), ))->send(); $kernel->terminate($request, $response); diff --git a/routes/attribute.php b/routes/attribute.php index dfb136b53..a71f6aa79 100644 --- a/routes/attribute.php +++ b/routes/attribute.php @@ -36,6 +36,6 @@ ->middleware('can:attributes.edit'); Route::patch( 'id:{attribute:id}/options/id:{option:id}/metadata-private', - [MetadataController::class, 'updateOrCreate'] + [MetadataController::class, 'updateOrCreate'], )->middleware('can:attributes.edit'); }); diff --git a/src/Domain/Redirect/Controllers/RedirectController.php b/src/Domain/Redirect/Controllers/RedirectController.php index 2ed08a0c4..e3c138392 100644 --- a/src/Domain/Redirect/Controllers/RedirectController.php +++ b/src/Domain/Redirect/Controllers/RedirectController.php @@ -25,7 +25,7 @@ public function index(RedirectIndexDto $dto): JsonResource public function store(RedirectCreateDto $dto): JsonResource { return RedirectResource::make( - $this->redirectService->create($dto) + $this->redirectService->create($dto), ); } @@ -37,7 +37,7 @@ public function show(Redirect $redirect): JsonResource public function update(Redirect $redirect, RedirectUpdateDto $dto): JsonResource { return RedirectResource::make( - $this->redirectService->update($redirect, $dto) + $this->redirectService->update($redirect, $dto), ); } diff --git a/tests/Feature/Attributes/AttributeTest.php b/tests/Feature/Attributes/AttributeTest.php index 9cf2d8b8b..335846124 100644 --- a/tests/Feature/Attributes/AttributeTest.php +++ b/tests/Feature/Attributes/AttributeTest.php @@ -144,7 +144,7 @@ public function testIndexMetadata(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']) + array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']), ); } @@ -195,7 +195,7 @@ public function testIndexMetadataPrivate(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']) + array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']), ); } @@ -873,7 +873,7 @@ public function testIndexOptionsMetadata(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -888,7 +888,7 @@ public function testIndexOptionsMetadata(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newOption, ['Dystrybucja' => 'Polska']) + array_merge($this->newOption, ['Dystrybucja' => 'Polska']), ); } @@ -904,7 +904,7 @@ public function testIndexOptionsMetadataNotFound(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -932,7 +932,7 @@ public function testIndexOptionsMetadataPrivate(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -947,7 +947,7 @@ public function testIndexOptionsMetadataPrivate(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newOption, ['Dystrybucja' => 'Polska']) + array_merge($this->newOption, ['Dystrybucja' => 'Polska']), ); } @@ -963,7 +963,7 @@ public function testIndexOptionsMetadataPrivateNotFound(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -1127,7 +1127,7 @@ public function testUpdateOption(string $user): void ->json( 'PATCH', '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertOk() ->assertJsonFragment($optionUpdate); @@ -1152,7 +1152,7 @@ public function testUpdateOptionWithoutId(string $user): void ->json( 'PATCH', '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertOk() ->assertJsonFragment($optionUpdate); @@ -1185,7 +1185,7 @@ public function testUpdateOptionIncompleteData(string $user): void ->json( 'PATCH', '/attributes/id:' . $attribute->getKey() . '/options/id:' . $option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertUnprocessable(); } @@ -1212,7 +1212,7 @@ public function testUpdateOptionNotExisting(string $user): void ->json( 'PATCH', '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertNotFound(); } @@ -1239,7 +1239,7 @@ public function testUpdateOptionNotRelatedOption(string $user): void ->json( 'PATCH', '/attributes/id:' . $attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertNotFound(); } @@ -1261,7 +1261,7 @@ public function testUpdateOptionUnauthorized(string $user): void ->actingAs($this->{$user}) ->patchJson( '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertForbidden(); } diff --git a/tests/Feature/AuthTest.php b/tests/Feature/AuthTest.php index 564a427b5..cd1a701d3 100644 --- a/tests/Feature/AuthTest.php +++ b/tests/Feature/AuthTest.php @@ -317,7 +317,7 @@ function ($job) use ($webHook, $userFailed, $attemptFailed) { && $payload['data_type'] === 'LocalizedLoginAttempt' && $payload['event'] === 'NewLocalizationLoginAttempt' && $payload['issuer_type'] === IssuerType::USER; - } + }, ); } @@ -821,7 +821,7 @@ public function testLogoutWithInvalidatedTokenAfterRefreshToken(): void [ 'refresh_token' => $refreshToken, ], - $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token] + $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token], ); $this @@ -829,7 +829,7 @@ public function testLogoutWithInvalidatedTokenAfterRefreshToken(): void 'POST', '/auth/logout', [], - $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token] + $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token], ) ->assertStatus(422); } @@ -1585,7 +1585,7 @@ public function testConfirmAppTfa(): void Notification::assertSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); $this->assertDatabaseHas('users', [ @@ -1647,7 +1647,7 @@ public function testConfirmAppTfaNoPreferences(): void Notification::assertNotSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); Event::assertNotDispatched(TfaRecoveryCodesChanged::class); @@ -1669,7 +1669,7 @@ public function testSetupEmailTfa(): void Notification::assertSentTo( [$this->user], - TFAInitialization::class + TFAInitialization::class, ); $this->assertDatabaseHas('users', [ @@ -1770,7 +1770,7 @@ public function testConfirmEmailTfa(): void Notification::assertSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); $this->assertDatabaseHas('users', [ @@ -1828,7 +1828,7 @@ public function testConfirmEmailTfaNoPreferences(): void Notification::assertNotSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); Event::assertNotDispatched(TfaRecoveryCodesChanged::class); @@ -1891,7 +1891,7 @@ public function testRecoveryCodesCreate($method, $secret): void Notification::assertSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); $recovery_codes = OneTimeSecurityCode::where('user_id', '=', $this->user->getKey()) @@ -1926,7 +1926,7 @@ public function testRecoveryCodesCreateNoPreferences($method, $secret): void Notification::assertNotSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); Event::assertNotDispatched(TfaRecoveryCodesChanged::class); diff --git a/tests/Feature/BannerTest.php b/tests/Feature/BannerTest.php index f9a7e003a..fe606b372 100644 --- a/tests/Feature/BannerTest.php +++ b/tests/Feature/BannerTest.php @@ -309,7 +309,7 @@ public function testCreateBannerWithMetadata($user): void 'metadata' => [ 'attributeMeta' => 'attributeValue', ], - ] + ], ) ->assertCreated() ->assertJsonFragment($this->newBanner) @@ -337,7 +337,7 @@ public function testCreateBannerWithMetadataPrivate($user): void 'metadata_private' => [ 'attributeMetaPriv' => 'attributeValue', ], - ] + ], ) ->assertCreated() ->assertJsonFragment($this->newBanner) @@ -416,7 +416,7 @@ public function testUpdateBanner($user): void ->actingAs($this->{$user}) ->patchJson( "/banners/id:{$this->banner->getKey()}", - $banner + ['banner_media' => [$bannerMedia + $medias]] + $banner + ['banner_media' => [$bannerMedia + $medias]], ) ->assertOk() ->assertJsonFragment($banner); diff --git a/tests/Feature/CartTest.php b/tests/Feature/CartTest.php index b082be72f..90afda4a5 100644 --- a/tests/Feature/CartTest.php +++ b/tests/Feature/CartTest.php @@ -779,7 +779,7 @@ public function testCartProcessCheapestProduct($user, $coupon): void 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -869,7 +869,7 @@ public function testCartProcessCheapestProductWithSamePrice($user, $coupon): voi 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -1734,7 +1734,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'type' => DiscountType::PERCENTAGE, 'target_type' => DiscountTargetType::PRODUCTS, 'target_is_allow_list' => true, - ] + $code + ] + $code, ); $discountApplied->productSets()->attach($parentSet); @@ -1747,7 +1747,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'type' => DiscountType::PERCENTAGE, 'target_type' => DiscountTargetType::PRODUCTS, 'target_is_allow_list' => false, - ] + $code + ] + $code, ); $discount->productSets()->attach($parentSet); @@ -1771,7 +1771,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -1787,7 +1787,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'shipping_price_initial' => 0, 'shipping_price' => 0, 'summary' => 4140, - ] + $result + ] + $result, ) ->assertJsonFragment([ 'cartitem_id' => '1', @@ -1799,14 +1799,14 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'id' => $discountApplied->getKey(), 'name' => $discountApplied->name, 'value' => 460, - ] + $discountCode1 + ] + $discountCode1, ) ->assertJsonMissing( [ 'id' => $discount->getKey(), 'name' => $discount->name, 'value' => 0, - ] + $discountCode2 + ] + $discountCode2, ); } @@ -1877,14 +1877,14 @@ public function testCartProcessSaleWithTargetProduct($user): void 'id' => $sale->getKey(), 'name' => $sale->name, 'value' => 0, - ] + ], ) ->assertJsonMissing( [ 'id' => $saleShippingMethod->getKey(), 'name' => $saleShippingMethod->name, 'value' => 0, - ] + ], ); } @@ -1906,7 +1906,7 @@ public function testCartProcessInactive($user, $coupon): void 'target_type' => DiscountTargetType::ORDER_VALUE, 'target_is_allow_list' => true, 'active' => false, - ] + $code + ] + $code, ); $conditionGroup = ConditionGroup::create(); @@ -1938,7 +1938,7 @@ public function testCartProcessInactive($user, $coupon): void 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -1953,7 +1953,7 @@ public function testCartProcessInactive($user, $coupon): void 'shipping_price_initial' => 0, 'shipping_price' => 0, 'summary' => 9200, - ] + $result + ] + $result, ) ->assertJsonFragment([ 'cartitem_id' => '1', @@ -1965,7 +1965,7 @@ public function testCartProcessInactive($user, $coupon): void 'id' => $discount->getKey(), 'name' => $discount->name, 'value' => 920, - ] + $discountCode + ] + $discountCode, ); } diff --git a/tests/Feature/CategoryTest.php b/tests/Feature/CategoryTest.php index 30963f0fa..c83a31e7c 100644 --- a/tests/Feature/CategoryTest.php +++ b/tests/Feature/CategoryTest.php @@ -29,7 +29,7 @@ public function testGoogleCategory($user): void 4992 - Animals & Pet Supplies > Pet Supplies > Bird Supplies > Bird Toys 4993 - Animals & Pet Supplies > Pet Supplies > Bird Supplies > Bird Treats 4 - Animals & Pet Supplies > Pet Supplies > Cat Supplies -' +', ), ]); $this->actingAs($this->{$user})->json('get', '/google-categories/en-US') diff --git a/tests/Feature/DepositsTest.php b/tests/Feature/DepositsTest.php index 56f9de4b3..66bbca050 100644 --- a/tests/Feature/DepositsTest.php +++ b/tests/Feature/DepositsTest.php @@ -633,22 +633,22 @@ public function testUpdateItemWithShippingTimeAndDateAndCountQuantityNeed(): voi $testCountTimeDate5 = $depositService->getShippingTimeDateForQuantity($item, 11); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $deposit2->shipping_date], - $testCountTimeDate5 + $testCountTimeDate5, ); $testCountTimeDate6 = $depositService->getShippingTimeDateForQuantity($item, 12); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $deposit1->shipping_date], - $testCountTimeDate6 + $testCountTimeDate6, ); $testCountTimeDate7 = $depositService->getShippingTimeDateForQuantity($item, 14); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $deposit3->shipping_date], - $testCountTimeDate7 + $testCountTimeDate7, ); $testCountTimeDate8 = $depositService->getShippingTimeDateForQuantity($item, 20); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $item->unlimited_stock_shipping_date], - $testCountTimeDate8 + $testCountTimeDate8, ); $item->update(['unlimited_stock_shipping_date' => null]); diff --git a/tests/Feature/Discounts/DiscountSearchTest.php b/tests/Feature/Discounts/DiscountSearchTest.php index f81c17e9b..e4203bb11 100644 --- a/tests/Feature/Discounts/DiscountSearchTest.php +++ b/tests/Feature/Discounts/DiscountSearchTest.php @@ -79,7 +79,7 @@ public function testIndexSearchByIds($kind): void 'ids' => [ $discount2->getKey(), ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') diff --git a/tests/Feature/Discounts/DiscountTest.php b/tests/Feature/Discounts/DiscountTest.php index e90a74161..f960e7eed 100644 --- a/tests/Feature/Discounts/DiscountTest.php +++ b/tests/Feature/Discounts/DiscountTest.php @@ -1230,7 +1230,7 @@ public function testCreateFull($user, $discountKind): void ConditionType::USER_IN, ConditionType::PRODUCT_IN, ConditionType::PRODUCT_IN_SET, - ] + ], ) ) { $response->assertJsonFragment($condition); @@ -1774,7 +1774,7 @@ public function testUpdateFull($user, $discountKind): void [ 'type' => ConditionType::MAX_USES, 'value' => ['max_uses' => 1000], - ] + ], ); $discount->conditionGroups()->attach($conditionGroup); @@ -1822,7 +1822,7 @@ public function testUpdateFull($user, $discountKind): void ConditionType::USER_IN, ConditionType::PRODUCT_IN, ConditionType::PRODUCT_IN_SET, - ] + ], ) ) { $response->assertJsonFragment($condition); diff --git a/tests/Feature/MetadataTest.php b/tests/Feature/MetadataTest.php index c7368c672..773482000 100644 --- a/tests/Feature/MetadataTest.php +++ b/tests/Feature/MetadataTest.php @@ -224,7 +224,7 @@ public function testAddMetadata($user, $data): void $response = $this->actingAs($this->{$user})->patchJson( "/{$data['prefix_url']}/id:{$object->getKey()}/metadata", - $metadata + $metadata, ); $response @@ -262,7 +262,7 @@ public function testAddMetadataPrivate($user, $data): void $this->actingAs($this->{$user})->patchJson( "/{$data['prefix_url']}/id:{$object->getKey()}/metadata-private", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -301,7 +301,7 @@ public function testUpdateMetadata($user, $data): void "/{$data['prefix_url']}/id:{$object->getKey()}/metadata", [ $metadata->name => 'new super value', - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -339,7 +339,7 @@ public function testUpdateMetadataSameKeys($user): void "/products/id:{$product->getKey()}/metadata", [ $metadata->name => 'new super value', - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -386,7 +386,7 @@ public function testUpdateMetadataPrivate($user, $data): void "/{$data['prefix_url']}/id:{$object->getKey()}/metadata-private", [ $metadata->name => 'new super value', - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -436,7 +436,7 @@ public function testDeleteMetadata($user, $data): void [ $metadata1->name => $metadata1->value, $metadata2->name => null, - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -489,7 +489,7 @@ public function testDeleteMetadataPrivate($user, $data): void [ $metadata1->name => $metadata1->value, $metadata2->name => null, - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -534,7 +534,7 @@ public function testAddMyMetadataPersonal(): void $this->actingAs($this->user)->json( 'PATCH', '/auth/profile/metadata-personal', - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -574,7 +574,7 @@ public function testUpdateMyMetadataPersonal(): void $this->actingAs($this->user)->json( 'PATCH', '/auth/profile/metadata-personal', - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -608,7 +608,7 @@ public function testDeleteMyMetadataPersonal(): void $this->actingAs($this->user)->json( 'PATCH', '/auth/profile/metadata-personal', - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => []]); @@ -639,7 +639,7 @@ public function testAddUserMetadataPersonal($user): void ->json( 'PATCH', "/users/id:{$model->getKey()}/metadata-personal", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -685,7 +685,7 @@ public function testUpdateUserMetadataPersonal($user): void $this->actingAs($this->{$user})->json( 'PATCH', "/users/id:{$model->getKey()}/metadata-personal", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -725,7 +725,7 @@ public function testDeleteUserMetadataPersonal($user): void $this->actingAs($this->{$user})->json( 'PATCH', "/users/id:{$model->getKey()}/metadata-personal", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => []]); diff --git a/tests/Feature/OrderCreateTest.php b/tests/Feature/OrderCreateTest.php index cdcbd8a79..f203ae020 100644 --- a/tests/Feature/OrderCreateTest.php +++ b/tests/Feature/OrderCreateTest.php @@ -1031,7 +1031,7 @@ public function testCantCreateOrderWithoutBillingAddress($user): void 'quantity' => 20, ], ], - ] + ], ) ->assertUnprocessable(); diff --git a/tests/Feature/OrderDocumentTest.php b/tests/Feature/OrderDocumentTest.php index c6ad37bc8..ba5d91d40 100644 --- a/tests/Feature/OrderDocumentTest.php +++ b/tests/Feature/OrderDocumentTest.php @@ -95,7 +95,7 @@ public function testDeleteDocument($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' - . $this->order->documents()->latest()->first()->pivot->id + . $this->order->documents()->latest()->first()->pivot->id, ); $response->assertStatus(204); @@ -186,7 +186,7 @@ public function testDownloadDocument($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' . $this->order->documents->last()->pivot->id - . '/download' + . '/download', ); $response @@ -218,7 +218,7 @@ public function testDownloadUserDocumentWithoutPermission($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' . $this->order->documents->last()->pivot->id - . '/download' + . '/download', ); $response @@ -250,7 +250,7 @@ public function testDownloadDocumentUnauthorized($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' . $this->order->documents->last()->pivot->id - . '/download' + . '/download', ); $response diff --git a/tests/Feature/OrderProductTest.php b/tests/Feature/OrderProductTest.php index 672302d7b..b987703f5 100644 --- a/tests/Feature/OrderProductTest.php +++ b/tests/Feature/OrderProductTest.php @@ -199,7 +199,7 @@ public function testOrderNotSendUrls($user): void ->actingAs($this->{$user}) ->json( 'POST', - '/orders/id:' . $this->order->getKey() . '/send-urls' + '/orders/id:' . $this->order->getKey() . '/send-urls', )->assertOk(); $this->assertDatabaseHas('order_products', [ @@ -230,7 +230,7 @@ public function testOrderSendUrls($user): void ->actingAs($this->{$user}) ->json( 'POST', - '/orders/id:' . $this->order->getKey() . '/send-urls' + '/orders/id:' . $this->order->getKey() . '/send-urls', )->assertOk(); $this->assertDatabaseHas('order_products', [ diff --git a/tests/Feature/OrderUpdateTest.php b/tests/Feature/OrderUpdateTest.php index 7f8ada018..99e04e76a 100644 --- a/tests/Feature/OrderUpdateTest.php +++ b/tests/Feature/OrderUpdateTest.php @@ -965,7 +965,7 @@ public function testShippingListDispatched($user): void '/orders/id:' . $this->order->getKey() . '/shipping-lists', [ 'package_template_id' => $package->getKey(), - ] + ], )->assertOk() ->assertJsonFragment([ 'id' => $this->order->getKey(), @@ -1009,7 +1009,7 @@ public function testShippingListNotExistingPackageTemplate($user): void '/orders/id:' . $this->order->getKey() . '/shipping-lists', [ 'package_template_id' => $package->getKey(), - ] + ], )->assertUnprocessable(); Event::assertNotDispatched(OrderRequestedShipping::class); @@ -1107,7 +1107,7 @@ public function testUpdateOrderProductUrl($user): void 'first_url' => 'https://example.com', 'second_url' => 'https://example2.com', ], - ] + ], ) ->assertOk(); @@ -1163,7 +1163,7 @@ public function testUpdateOneOrderProductUrl($user): void 'urls' => [ 'updated_url' => 'https://updated.com', ], - ] + ], ) ->assertOk(); @@ -1222,7 +1222,7 @@ public function testUpdateOrderDigitalShippingMethod($user): void "/orders/id:{$order->getKey()}", [ 'digital_shipping_method_id' => $digitalShippingMethodNew->getKey(), - ] + ], ) ->assertOk() ->assertJsonFragment([ @@ -1271,7 +1271,7 @@ public function testUpdateOrderDigital($user): void "/orders/id:{$order->getKey()}", [ 'comment' => 'New comment', - ] + ], ) ->assertOk() ->assertJsonFragment([ @@ -1314,7 +1314,7 @@ public function testDeleteOrderProductUrl($user): void 'old_url' => null, 'second_url' => 'https://example2.com', ], - ] + ], ) ->assertOk(); diff --git a/tests/Feature/PageTest.php b/tests/Feature/PageTest.php index 61b322e0c..dec24b127 100644 --- a/tests/Feature/PageTest.php +++ b/tests/Feature/PageTest.php @@ -720,7 +720,7 @@ public function testUpdateWithSeo($user, $boolean, $booleanValue): void $response = $this->actingAs($this->{$user})->json( 'PATCH', '/pages/id:' . $this->page->getKey(), - $page + $page, ); $response diff --git a/tests/Feature/PerformanceTest.php b/tests/Feature/PerformanceTest.php index 22ccf49ab..7e5750690 100644 --- a/tests/Feature/PerformanceTest.php +++ b/tests/Feature/PerformanceTest.php @@ -503,7 +503,7 @@ public function testViewOrderPerformanceWithDiscounts(): void 'target_type' => $discountOrder->target_type, 'applied_discount' => $order->shipping_price_initial, 'code' => $discountOrder->code, - ] + ], ); $discountProduct = Discount::factory()->create([ diff --git a/tests/Feature/ProductAvailabilityTest.php b/tests/Feature/ProductAvailabilityTest.php index be6ba83ae..f7d24ae18 100644 --- a/tests/Feature/ProductAvailabilityTest.php +++ b/tests/Feature/ProductAvailabilityTest.php @@ -140,7 +140,7 @@ public function testMultipleItemsDeposits($user): void $item3->getKey() => [ 'required_quantity' => 1, // 4 ], - ] + ], ); $this @@ -220,7 +220,7 @@ public function testMultipleItemsSameQuantityDeposits($user): void $item4->getKey() => [ 'required_quantity' => 1, ], - ] + ], ); // After adding this deposit should be: diff --git a/tests/Feature/ProductSearchDatabaseTest.php b/tests/Feature/ProductSearchDatabaseTest.php index fd405c5fc..3ddb0382a 100644 --- a/tests/Feature/ProductSearchDatabaseTest.php +++ b/tests/Feature/ProductSearchDatabaseTest.php @@ -708,7 +708,7 @@ public function testSearchByAttributeId($user): void 'attribute' => [ $attribute->slug => $options[0]->getKey(), ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -774,7 +774,7 @@ public function testSearchByAttributeMultippleId($user): void $option2->getKey(), ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -839,7 +839,7 @@ public function testSearchByAttributeNumber($user): void 'max' => 2137, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -866,7 +866,7 @@ public function testSearchByAttributeNumber($user): void 'min' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -893,7 +893,7 @@ public function testSearchByAttributeNumber($user): void 'min' => 2337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -909,7 +909,7 @@ public function testSearchByAttributeNumber($user): void 'max' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -963,7 +963,7 @@ public function testSearchByAttributeDate($user): void 'max' => '2022-09-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -991,7 +991,7 @@ public function testSearchByAttributeDate($user): void 'max' => '2022-11-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1018,7 +1018,7 @@ public function testSearchByAttributeDate($user): void 'min' => '2022-12-01', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1034,7 +1034,7 @@ public function testSearchByAttributeDate($user): void 'max' => '2022-09-10', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1078,7 +1078,7 @@ public function testSearchByAttributeNotId($user): void 'attribute_not' => [ $attribute->slug => $options[0]->getKey(), ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -1138,7 +1138,7 @@ public function testSearchByAttributeNotNumber($user): void 'max' => 2137, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -1160,7 +1160,7 @@ public function testSearchByAttributeNotNumber($user): void 'min' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1176,7 +1176,7 @@ public function testSearchByAttributeNotNumber($user): void 'min' => 2337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1198,7 +1198,7 @@ public function testSearchByAttributeNotNumber($user): void 'max' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1258,7 +1258,7 @@ public function testSearchByAttributeNotDate($user): void 'max' => '2022-09-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -1281,7 +1281,7 @@ public function testSearchByAttributeNotDate($user): void 'max' => '2022-11-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1297,7 +1297,7 @@ public function testSearchByAttributeNotDate($user): void 'min' => '2022-12-01', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1319,7 +1319,7 @@ public function testSearchByAttributeNotDate($user): void 'max' => '2022-09-10', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') diff --git a/tests/Feature/ProductSetCreateTest.php b/tests/Feature/ProductSetCreateTest.php index a2e644b04..39d8b1547 100644 --- a/tests/Feature/ProductSetCreateTest.php +++ b/tests/Feature/ProductSetCreateTest.php @@ -174,7 +174,7 @@ public function testCreateTreeViewFalse($user): void 'product_sets', $set + $defaults + [ 'parent_id' => null, - ] + ], ); Event::assertDispatched(ProductSetCreated::class); diff --git a/tests/Feature/ProductSetOtherTest.php b/tests/Feature/ProductSetOtherTest.php index 36b05b63b..d05dca4af 100644 --- a/tests/Feature/ProductSetOtherTest.php +++ b/tests/Feature/ProductSetOtherTest.php @@ -520,7 +520,7 @@ public function testProductReorderInSetHigherOrder($user): void 'order' => 0, ], ], - ] + ], ); $this @@ -564,7 +564,7 @@ public function testProductReorderInSetLowerOrder($user): void 'order' => 4, ], ], - ] + ], ); $this @@ -608,7 +608,7 @@ public function testProductReorderInSetSameOrder($user): void 'order' => 2, ], ], - ] + ], ); $this @@ -652,7 +652,7 @@ public function testProductReorderInSetOrderOutOfSize($user): void 'order' => 9999, ], ], - ] + ], ); $this @@ -706,7 +706,7 @@ public function testProductReorderWhenWasNull($user): void 'order' => 0, ], ], - ] + ], ); $this @@ -758,7 +758,7 @@ public function testProductReorderHandleNulls($user): void 'order' => 0, ], ], - ] + ], ); $this diff --git a/tests/Feature/ProductSetUpdateTest.php b/tests/Feature/ProductSetUpdateTest.php index b41aed8d8..165b2326b 100644 --- a/tests/Feature/ProductSetUpdateTest.php +++ b/tests/Feature/ProductSetUpdateTest.php @@ -132,7 +132,7 @@ public function testUpdateTreeFalse($user): void 'product_sets', $set + $parentId + [ 'slug' => 'test-edit', - ] + ], ); Event::assertDispatched(ProductSetUpdated::class); diff --git a/tests/Feature/Products/ProductSortTest.php b/tests/Feature/Products/ProductSortTest.php index 624b7454a..a8b017a18 100644 --- a/tests/Feature/Products/ProductSortTest.php +++ b/tests/Feature/Products/ProductSortTest.php @@ -49,7 +49,7 @@ private function createProductWithAttribute(Attribute $attribute, string $option ]); $product->attributes()->attach($attribute->getKey()); $product->attributes()->get()->each( - fn (Attribute $attribute) => $attribute->pivot->options()->attach($option->getKey()) + fn (Attribute $attribute) => $attribute->pivot->options()->attach($option->getKey()), ); return $product; diff --git a/tests/Feature/ProviderTest.php b/tests/Feature/ProviderTest.php index e98cda525..0d63a75fb 100644 --- a/tests/Feature/ProviderTest.php +++ b/tests/Feature/ProviderTest.php @@ -270,7 +270,7 @@ public function testLoginNewUser($key): void "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ); $response->assertJsonStructure( @@ -290,7 +290,7 @@ public function testLoginNewUser($key): void 'permissions', ], ], - ] + ], ); } @@ -327,7 +327,7 @@ public function testLoginExistingUser($key): void "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ); $response->assertJsonStructure( @@ -347,7 +347,7 @@ public function testLoginExistingUser($key): void 'permissions', ], ], - ] + ], ); } @@ -378,7 +378,7 @@ public function testLoginExistingStandardUserRegistered($key): void "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ) ->assertStatus(JsonResponse::HTTP_UNPROCESSABLE_ENTITY) ->assertJsonFragment(['message' => Exceptions::CLIENT_ALREADY_HAS_ACCOUNT]); @@ -429,7 +429,7 @@ public function testLoginExistingStandardUserRegisteredAndProviderAlreadyUsed($k "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ) ->assertStatus(JsonResponse::HTTP_UNPROCESSABLE_ENTITY) ->assertJsonFragment(['message' => Exceptions::CLIENT_ALREADY_HAS_ACCOUNT]); diff --git a/tests/Feature/ShippingMethodTest.php b/tests/Feature/ShippingMethodTest.php index 462a0da67..8f85fc2ec 100644 --- a/tests/Feature/ShippingMethodTest.php +++ b/tests/Feature/ShippingMethodTest.php @@ -816,7 +816,7 @@ public function testUpdateWithEmptyData($user): void $response = $this->actingAs($this->{$user})->patchJson( '/shipping-methods/id:' . $this->shipping_method->getKey(), - [] + [], ); $response diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php index c3e15d777..ae314b345 100644 --- a/tests/Feature/UserTest.php +++ b/tests/Feature/UserTest.php @@ -834,7 +834,7 @@ public function testCreateRolesMissingPermissions($user): void return str_contains( $message, 'ClientException(code: 422): ' - . "Can't give a role with permissions you don't have to the user at" + . "Can't give a role with permissions you don't have to the user at", ); }); diff --git a/tests/Traits/CreateShippingMethod.php b/tests/Traits/CreateShippingMethod.php index bfa816c7a..9143b80a2 100644 --- a/tests/Traits/CreateShippingMethod.php +++ b/tests/Traits/CreateShippingMethod.php @@ -11,7 +11,7 @@ trait CreateShippingMethod public function createShippingMethod( float $price = 0, - array $payload = ['shipping_type' => ShippingType::ADDRESS] + array $payload = ['shipping_type' => ShippingType::ADDRESS], ): ShippingMethod { $this->shippingMethod = ShippingMethod::factory()->create($payload); $priceRange = $this->shippingMethod->priceRanges()->create([ diff --git a/tests/Unit/AnalyticsServiceTest.php b/tests/Unit/AnalyticsServiceTest.php index 4a126104e..e4e6d3745 100644 --- a/tests/Unit/AnalyticsServiceTest.php +++ b/tests/Unit/AnalyticsServiceTest.php @@ -140,7 +140,7 @@ private function testGetPaymentsOverPeriodGroup( Carbon $groupTwo1, string $labelOne, string $labelTwo, - string $group + string $group, ): void { $order = Order::factory()->create(); diff --git a/tests/Unit/DiscountApplyTest.php b/tests/Unit/DiscountApplyTest.php index 4ea5d1117..32afe0ce8 100644 --- a/tests/Unit/DiscountApplyTest.php +++ b/tests/Unit/DiscountApplyTest.php @@ -293,7 +293,7 @@ public function testApplyDiscountToProduct($type, $value, $result, $discountKind $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -330,7 +330,7 @@ public function testApplyDiscountToProductNotAllowList($type, $value, $result, $ $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -365,7 +365,7 @@ public function testApplyDiscountToProductInProductSets($type, $value, $result, $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -403,7 +403,7 @@ public function testApplyDiscountToProductInProductSetsNotAllowList($type, $valu $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -434,7 +434,7 @@ public function testDiscountNotApplyToProduct($type, $value, $result, $discountK $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); @@ -467,7 +467,7 @@ public function testDiscountNotApplyToProductNotAllowList($type, $value, $result $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); @@ -496,7 +496,7 @@ public function testDiscountNotApplyToProductInProductSets($type, $value, $resul $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); @@ -529,7 +529,7 @@ public function testDiscountNotApplyToProductInProductSetsNotAllowList($type, $v $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); diff --git a/tests/Unit/DiscountConditionsCheckTest.php b/tests/Unit/DiscountConditionsCheckTest.php index 89c1a3233..db2577129 100644 --- a/tests/Unit/DiscountConditionsCheckTest.php +++ b/tests/Unit/DiscountConditionsCheckTest.php @@ -76,7 +76,7 @@ public function testCheckConditionGroupPass(): void $this->conditionGroup, $cart, 40.0, - ) + ), ); } @@ -102,7 +102,7 @@ public function testCheckConditionGroupFail(): void $this->conditionGroup, $cart, 40.0, - ) + ), ); } @@ -136,7 +136,7 @@ public function testCheckConditionGroupsPass(): void $this->discount, $cart, 120.0, - ) + ), ); } @@ -168,7 +168,7 @@ public function testCheckConditionGroupsFail(): void $this->discount, $cart, 120.0, - ) + ), ); } diff --git a/tests/Unit/ProductServiceTest.php b/tests/Unit/ProductServiceTest.php index f9598883f..2daae7a5d 100644 --- a/tests/Unit/ProductServiceTest.php +++ b/tests/Unit/ProductServiceTest.php @@ -44,7 +44,7 @@ public static function schemaProvider(): array return [ 'optional schema' => array_merge( $base, - [SchemaType::STRING, false, [$price, $price + $schemaPrice]] + [SchemaType::STRING, false, [$price, $price + $schemaPrice]], ), 'boolean schema' => array_merge( $base, diff --git a/tests/Unit/ResetTokenMailTest.php b/tests/Unit/ResetTokenMailTest.php index 46ecaebd1..454ab0332 100644 --- a/tests/Unit/ResetTokenMailTest.php +++ b/tests/Unit/ResetTokenMailTest.php @@ -12,7 +12,7 @@ public function testHasCorrectUrl(): void $notification = new ResetPassword('testtoken', 'https://example.com'); $this->assertTrue( $notification->toMail($this->user) - ->viewData['url'] === 'https://example.com?token=testtoken&email=' . urlencode($this->user->email) + ->viewData['url'] === 'https://example.com?token=testtoken&email=' . urlencode($this->user->email), ); } } diff --git a/tests/Unit/Rules/AttributeSearchTest.php b/tests/Unit/Rules/AttributeSearchTest.php index 6cf7cce7e..8fbb5a2f8 100644 --- a/tests/Unit/Rules/AttributeSearchTest.php +++ b/tests/Unit/Rules/AttributeSearchTest.php @@ -25,7 +25,7 @@ public function testValidateMinMaxPassMin(): void 'value' => [ 'min' => 1, ], - ] + ], )); } diff --git a/tests/Unit/UndotParamsTest.php b/tests/Unit/UndotParamsTest.php index 341c5ac56..edc1526e9 100644 --- a/tests/Unit/UndotParamsTest.php +++ b/tests/Unit/UndotParamsTest.php @@ -34,7 +34,7 @@ public function testUndotParamsMiddlewareNested(): void 'Zagraniczny' => '0', ], ], - $req->metadata + $req->metadata, ); }); } @@ -64,7 +64,7 @@ public function testUndotParamsMiddlewareMixed(): void 'Dystrybucja' => ['Polska', 'Francja'], ], ], - $req->metadata + $req->metadata, ); $this->assertEquals('test', $req->not_related_param); $this->assertNotEquals('Heseya', $req->metadata_Producent); diff --git a/tests/Unit/UrlServiceTest.php b/tests/Unit/UrlServiceTest.php index 98ed2afa9..f19544959 100644 --- a/tests/Unit/UrlServiceTest.php +++ b/tests/Unit/UrlServiceTest.php @@ -49,7 +49,7 @@ public function testUrlSetPath(): void 'https://example.com/path?get=true#fragment', $this->urlService->urlSetPath( 'https://example.com?get=true#fragment', - 'path/' + 'path/', ), ); } @@ -60,7 +60,7 @@ public function testUrlAppendPath(): void 'https://example.com/path/subpath?get=true#fragment', $this->urlService->urlAppendPath( 'https://example.com/path?get=true#fragment', - '/subpath/' + '/subpath/', ), ); } @@ -71,7 +71,7 @@ public function testUrlAppendPathToNone(): void 'https://example.com/path?get=true#fragment', $this->urlService->urlAppendPath( 'https://example.com?get=true#fragment', - '/path/' + '/path/', ), ); }