From 948d1caba49e18612417359ebfc5c18b9a8a9a99 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Mon, 20 May 2024 14:21:40 +0700 Subject: [PATCH] Refactoring --- src/ActiveRecordInterface.php | 7 +++---- src/ActiveRelationTrait.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ActiveRecordInterface.php b/src/ActiveRecordInterface.php index f797ef850..4843b6d50 100644 --- a/src/ActiveRecordInterface.php +++ b/src/ActiveRecordInterface.php @@ -187,20 +187,19 @@ public function getPrimaryKey(bool $asArray = false): mixed; /** * Returns the relation object with the specified name. * - * @param string $name The relation name (case-sensitive). + * @param string $name The relation name, for example `orders` (case-sensitive). * * @return ActiveRecordInterface|array|null The relation object. */ public function relation(string $name): self|array|null; /** - * Returns the relation object with the specified name. + * Returns the relation query object with the specified name. * * A relation is defined by a getter method which returns an object implementing the {@see ActiveQueryInterface} * (normally this would be a relational {@see ActiveQuery} object). * - * @param string $name The relation name, for example `orders` for a relation defined via `getOrders()` method - * (case-sensitive). + * @param string $name The relation name, for example `orders` (case-sensitive). * @param bool $throwException Whether to throw exception if the relation doesn't exist. * * @return ActiveQueryInterface|null The relational query object. diff --git a/src/ActiveRelationTrait.php b/src/ActiveRelationTrait.php index 2b066081a..76fbd53a9 100644 --- a/src/ActiveRelationTrait.php +++ b/src/ActiveRelationTrait.php @@ -639,7 +639,7 @@ private function getModelKey(ActiveRecordInterface|array $activeRecord, array $a * * @return int|string|null normalized key value. */ - private function normalizeModelKey(int|null|string|Stringable $value): int|string|null + private function normalizeModelKey(int|string|Stringable|null $value): int|string|null { if ($value instanceof Stringable) { /**