Skip to content

Commit

Permalink
Handle end return type without docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMuller committed Sep 4, 2024
1 parent 28131a1 commit a03884d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Relations/BelongsToThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,12 @@ public function getThroughParents()
*/
public function getFirstForeignKeyName()
{
/** @var \Illuminate\Database\Eloquent\Model $firstThroughParent */
$firstThroughParent = end($this->throughParents);

if ($firstThroughParent === false) {
$firstThroughParent = $this->parent;
}

return $this->prefix . $this->getForeignKeyName($firstThroughParent);
}

Expand All @@ -348,9 +351,12 @@ public function getFirstForeignKeyName()
*/
public function getQualifiedFirstLocalKeyName()
{
/** @var \Illuminate\Database\Eloquent\Model $lastThroughParent */
$lastThroughParent = end($this->throughParents);

if ($lastThroughParent === false) {
$lastThroughParent = $this->parent;
}

return $lastThroughParent->qualifyColumn($this->getLocalKeyName($lastThroughParent));
}

Expand Down

0 comments on commit a03884d

Please sign in to comment.