phpstan.yml #160
Annotations
12 warnings
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/checkout@v2. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Run tests:
src/Console/Commands/AbandonedCart.php#L27
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
}
public function handle(): void
{
- $abandonedCarts = $this->shopService->getAbandonedCarts(Carbon::now()->subHours(24), Carbon::now());
+ $abandonedCarts = $this->shopService->getAbandonedCarts(Carbon::now()->subHours(25), Carbon::now());
/** @var Cart $abandonedCart */
foreach ($abandonedCarts as $abandonedCart) {
event(new AbandonedCartEvent($abandonedCart));
|
Run tests:
src/Enums/ExportFormatEnum.php#L25
Escaped Mutant for Mutator "MatchArmRemoval":
@@ @@
public function getWriterType(): string
{
return match ($this->value) {
- self::XLS => Excel::XLS,
self::XLSX => Excel::XLSX,
default => Excel::CSV,
};
}
}
|
Run tests:
src/Enums/ExportFormatEnum.php#L25
Escaped Mutant for Mutator "MatchArmRemoval":
@@ @@
{
return match ($this->value) {
self::XLS => Excel::XLS,
- self::XLSX => Excel::XLSX,
default => Excel::CSV,
};
}
}
|
Run tests:
src/Exports/OrdersExport.php#L30
Escaped Mutant for Mutator "Foreach_":
@@ @@
{
return collect($this->orders)->map(function ($order) {
$result = [];
- foreach ($this->keys as $key) {
+ foreach ([] as $key) {
$result[$key] = $order[$key] ?? '';
}
return $result;
|
Run tests:
src/Http/Requests/Admin/OrderExportRequest.php#L13
Escaped Mutant for Mutator "LogicalAnd":
@@ @@
{
public function authorize()
{
- return $this->user('api') && $this->user('api')->can('export', Order::class);
+ return $this->user('api') || $this->user('api')->can('export', Order::class);
}
public function rules()
{
|
Run tests:
src/Http/Resources/OrderExportResource.php#L29
Escaped Mutant for Mutator "ArrayItem":
@@ @@
}
public function toArray($request): array
{
- return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' => $this->getOrder()->tax, 'created_at' => $this->getOrder()->created_at, 'user_id' => $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' => $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
+ return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' > $this->getOrder()->tax, 'created_at' => $this->getOrder()->created_at, 'user_id' => $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' => $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
}
}
|
Run tests:
src/Http/Resources/OrderExportResource.php#L30
Escaped Mutant for Mutator "ArrayItem":
@@ @@
}
public function toArray($request): array
{
- return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' => $this->getOrder()->tax, 'created_at' => $this->getOrder()->created_at, 'user_id' => $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' => $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
+ return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' => $this->getOrder()->tax, 'created_at' > $this->getOrder()->created_at, 'user_id' => $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' => $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
}
}
|
Run tests:
src/Http/Resources/OrderExportResource.php#L31
Escaped Mutant for Mutator "ArrayItem":
@@ @@
}
public function toArray($request): array
{
- return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' => $this->getOrder()->tax, 'created_at' => $this->getOrder()->created_at, 'user_id' => $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' => $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
+ return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' => $this->getOrder()->tax, 'created_at' => $this->getOrder()->created_at, 'user_id' > $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' => $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
}
}
|
Run tests:
src/Http/Resources/OrderExportResource.php#L37
Escaped Mutant for Mutator "ArrayItem":
@@ @@
}
public function toArray($request): array
{
- return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' => $this->getOrder()->tax, 'created_at' => $this->getOrder()->created_at, 'user_id' => $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' => $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
+ return ['id' => $this->getOrder()->getKey(), 'status' => OrderStatus::getName($this->getOrder()->status), 'items' => OrderItemExportResource::collection($this->getOrder()->items), 'total' => $this->getOrder()->total, 'subtotal' => $this->getOrder()->subtotal, 'tax' => $this->getOrder()->tax, 'created_at' => $this->getOrder()->created_at, 'user_id' => $this->getOrder()->user_id, 'client_name' => $this->getOrder()->client_name, 'client_email' => $this->getOrder()->client_email, 'client_street' => $this->getOrder()->client_street, 'client_street_number' => $this->getOrder()->client_street_number, 'client_postal' => $this->getOrder()->client_postal, 'client_city' > $this->getOrder()->client_city, 'client_country' => $this->getOrder()->client_country, 'client_company' => $this->getOrder()->client_company, 'client_taxid' => $this->getOrder()->client_taxid];
}
}
|
Run tests:
src/Jobs/RenewRecursiveProductUser.php#L50
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
/** @var User $user */
$user = User::find($this->productUser->user_id);
/** @var Order $order */
- $order = $user->orders()->whereIn('status', [OrderStatus::PAID, OrderStatus::TRIAL_PAID])->whereRelation('items', fn(Builder $query) => $query->whereMorphRelation('buyable', [Product::class], 'buyable_id', '=', $product->getKey()))->orderBy('created_at', 'desc')->first();
+ $order = $user->orders()->whereIn('status', [OrderStatus::PAID, OrderStatus::TRIAL_PAID])->whereRelation('items', fn(Builder $query) => $query->whereMorphRelation('buyable', [], 'buyable_id', '=', $product->getKey()))->orderBy('created_at', 'desc')->first();
$prevPayment = $order->payments()->whereIn('status', [PaymentStatus::PAID(), PaymentStatus::REFUNDED()])->orderBy('created_at', 'desc')->first();
$paymentDriver = PaymentGateway::driver($prevPayment->driver);
if (!$paymentDriver->ableToRenew()) {
|
Loading