Skip to content

[12.x] use "class-string" where appropriate in relations #55074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ abstract class MorphOneOrMany extends HasOneOrMany
/**
* The class name of the parent model.
*
* @var string
* @var class-string<TRelatedModel>
*/
protected $morphClass;

Expand Down Expand Up @@ -159,7 +159,7 @@ public function getMorphType()
/**
* Get the class name of the parent model.
*
* @return string
* @return class-string<TRelatedModel>
*/
public function getMorphClass()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/MorphPivot.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MorphPivot extends Pivot
*
* Explicitly define this so it's not included in saved attributes.
*
* @var string
* @var class-string
*/
protected $morphClass;

Expand Down Expand Up @@ -100,7 +100,7 @@ public function setMorphType($morphType)
/**
* Set the morph class for the pivot.
*
* @param string $morphClass
* @param class-string $morphClass
* @return \Illuminate\Database\Eloquent\Relations\MorphPivot
*/
public function setMorphClass($morphClass)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/MorphToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MorphToMany extends BelongsToMany
/**
* The class name of the morph type constraint.
*
* @var string
* @var class-string<TRelatedModel>
*/
protected $morphClass;

Expand Down Expand Up @@ -212,7 +212,7 @@ public function getQualifiedMorphTypeName()
/**
* Get the class name of the parent model.
*
* @return string
* @return class-string<TRelatedModel>
*/
public function getMorphClass()
{
Expand Down
Loading