Skip to content

Commit

Permalink
add stricter type return to Model::getKey
Browse files Browse the repository at this point in the history
  • Loading branch information
treyssatvincent authored Oct 24, 2024
1 parent 4b5ce19 commit b9fbd73
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1985,20 +1985,16 @@ public function setIncrementing($value)

/**
* Get the value of the model's primary key.
*
* @return mixed
*/
public function getKey()
public function getKey(): int|string
{
return $this->getAttribute($this->getKeyName());
}

/**
* Get the queueable identity for the entity.
*
* @return mixed
*/
public function getQueueableId()
public function getQueueableId(): int|string
{
return $this->getKey();
}
Expand Down

0 comments on commit b9fbd73

Please sign in to comment.