From 13712e582d83bf50f86f47825549af6feea173e1 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 13 Nov 2023 15:32:22 +0000 Subject: [PATCH] [rector] Rector fixes --- src/ComplexResultBucket.php | 8 ++------ src/RejectionResultBucket.php | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ComplexResultBucket.php b/src/ComplexResultBucket.php index 7c421de..cfa7386 100644 --- a/src/ComplexResultBucket.php +++ b/src/ComplexResultBucket.php @@ -49,9 +49,7 @@ public function reasons(): ?array { return array_reduce( array_map( - function (Contract\RejectionResultBucketInterface $rejection): ?array { - return $rejection->reasons(); - }, + fn(Contract\RejectionResultBucketInterface $rejection): ?array => $rejection->reasons(), $this->rejections ), function (array $carry, ?array $item): array { @@ -68,9 +66,7 @@ public function exceptions(): ?array { return array_reduce( array_map( - function (Contract\RejectionResultBucketInterface $rejection): ?array { - return $rejection->exceptions(); - }, + fn(Contract\RejectionResultBucketInterface $rejection): ?array => $rejection->exceptions(), $this->rejections ), function (array $carry, ?array $item): array { diff --git a/src/RejectionResultBucket.php b/src/RejectionResultBucket.php index 177d2c1..6187e40 100644 --- a/src/RejectionResultBucket.php +++ b/src/RejectionResultBucket.php @@ -18,8 +18,8 @@ final class RejectionResultBucket implements Contract\RejectionResultBucketInter /** @param Type ...$values */ public function __construct( - private string $reason, - private \Throwable $exception, + private readonly string $reason, + private readonly \Throwable $exception, ...$values, ) { $this->values = array_values($values);