fix: resolve PHPStan static analysis warnings

This commit is contained in:
xboard committed 2025-04-14 02:12:42 +08:00
1 parent 9e2f46c688
commit b885e644a8
84 files changed
+2330 -1190

No files matched your search

+6 -2
View File
@@ -2,10 +2,14 @@
namespace App\Http\Resources;
use App\Models\Order;
use App\Services\PlanService;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin Order
*/
class OrderResource extends JsonResource
{
/**
@@ -17,8 +21,8 @@ class OrderResource extends JsonResource
{
return [
...parent::toArray($request),
'period' => PlanService::getLegacyPeriod($this->period),
'plan' => PlanResource::make($this->plan),
'period' => PlanService::getLegacyPeriod((string)$this->period),
'plan' => $this->whenLoaded('plan', fn() => PlanResource::make($this->plan)),
];
}
}