Skip to content
Merged
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
18 changes: 9 additions & 9 deletions src/Illuminate/Database/Eloquent/Relations/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ abstract class Relation implements BuilderContract
protected static $constraints = true;

/**
* An array to map class names to their morph names in the database.
* An array to map morph names to their class names in the database.
*
* @var array
* @var array<string, class-string<\Illuminate\Database\Eloquent\Model>>
*/
public static $morphMap = [];

Expand Down Expand Up @@ -451,7 +451,7 @@ public static function requiresMorphMap()
/**
* Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped.
*
* @param array $map
* @param array<string, class-string<\Illuminate\Database\Eloquent\Model>> $map
* @param bool $merge
* @return array
*/
Expand All @@ -465,9 +465,9 @@ public static function enforceMorphMap(array $map, $merge = true)
/**
* Set or get the morph map for polymorphic relations.
*
* @param array|null $map
* @param array<string, class-string<\Illuminate\Database\Eloquent\Model>>|null $map
* @param bool $merge
* @return array
* @return array<string, class-string<\Illuminate\Database\Eloquent\Model>>
*/
public static function morphMap(?array $map = null, $merge = true)
{
Expand All @@ -484,8 +484,8 @@ public static function morphMap(?array $map = null, $merge = true)
/**
* Builds a table-keyed array from model class names.
*
* @param string[]|null $models
* @return array|null
* @param list<class-string<\Illuminate\Database\Eloquent\Model>>|null $models
* @return array<string, class-string<\Illuminate\Database\Eloquent\Model>>|null
*/
protected static function buildMorphMapFromModels(?array $models = null)
{
Expand All @@ -502,7 +502,7 @@ protected static function buildMorphMapFromModels(?array $models = null)
* Get the model associated with a custom polymorphic type.
*
* @param string $alias
* @return string|null
* @return class-string<\Illuminate\Database\Eloquent\Model>|null
*/
public static function getMorphedModel($alias)
{
Expand All @@ -512,7 +512,7 @@ public static function getMorphedModel($alias)
/**
* Get the alias associated with a custom polymorphic class.
*
* @param string $className
* @param class-string<\Illuminate\Database\Eloquent\Model> $className
* @return int|string
*/
public static function getMorphAlias(string $className)
Expand Down