mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-15 04:10:51 +08:00
fix: resolve PHPStan static analysis warnings
This commit is contained in:
@@ -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)),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user