Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed May 20, 2024
1 parent 23bd177 commit 948d1ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/ActiveRecordInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/ActiveRelationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/**
Expand Down

0 comments on commit 948d1ca

Please sign in to comment.