From e849bdbf1c01c8fdb77f2273b4d5956ffce9679b Mon Sep 17 00:00:00 2001 From: AmonDeShir Date: Wed, 7 Aug 2024 08:37:08 +0200 Subject: [PATCH] Add return type to lambdas --- app/Models/Repository.php | 4 ++-- app/Models/WorkflowActor.php | 4 ++-- app/Models/WorkflowJob.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Models/Repository.php b/app/Models/Repository.php index 0f8fe349..32a70f2a 100644 --- a/app/Models/Repository.php +++ b/app/Models/Repository.php @@ -57,11 +57,11 @@ public function organization(): BelongsTo protected function totalMinutes(): Attribute { - return Attribute::get(fn() => $this->workflowJobs->sum("minutes")); + return Attribute::get(fn(): float => $this->workflowJobs->sum("minutes")); } protected function totalPrice(): Attribute { - return Attribute::get(fn() => $this->workflowJobs->sum("price")); + return Attribute::get(fn(): float => $this->workflowJobs->sum("price")); } } diff --git a/app/Models/WorkflowActor.php b/app/Models/WorkflowActor.php index 22a4f579..fb72b3a3 100644 --- a/app/Models/WorkflowActor.php +++ b/app/Models/WorkflowActor.php @@ -48,11 +48,11 @@ public function workflowJobs(): HasManyThrough protected function totalMinutes(): Attribute { - return Attribute::get(fn() => $this->workflowJobs->sum("minutes")); + return Attribute::get(fn(): float => $this->workflowJobs->sum("minutes")); } protected function totalPrice(): Attribute { - return Attribute::get(fn() => $this->workflowJobs->sum("price")); + return Attribute::get(fn(): float => $this->workflowJobs->sum("price")); } } diff --git a/app/Models/WorkflowJob.php b/app/Models/WorkflowJob.php index fd3aea8f..945874bf 100644 --- a/app/Models/WorkflowJob.php +++ b/app/Models/WorkflowJob.php @@ -50,11 +50,11 @@ public function workflowRun(): BelongsTo protected function price(): Attribute { - return Attribute::get(fn() => $this->minutes * $this->price_per_unit); + return Attribute::get(fn(): float => $this->minutes * $this->price_per_unit); } protected function fullName(): Attribute { - return Attribute::get(fn() => $this->workflowRun->name . " - " . $this->name); + return Attribute::get(fn(): string => $this->workflowRun->name . " - " . $this->name); } }