Skip to content
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

Align type definitions to Laravel #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 14 additions & 5 deletions src/HasChildren.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ trait HasChildren
* Register a model event with the dispatcher.
*
* @param string $event
* @param Closure|string $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
*/
protected static function registerModelEvent($event, $callback): void
{
Expand Down Expand Up @@ -124,10 +124,13 @@ public function newFromBuilder($attributes = [], $connection = null): self
/**
* Define an inverse one-to-one or many relationship.
*
* @param string $related
* @template TRelatedModel of \Illuminate\Database\Eloquent\Model
*
* @param class-string<TRelatedModel> $related
* @param string|null $foreignKey
* @param string|null $ownerKey
* @param string|null $relation
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TRelatedModel, $this>
*/
public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relation = null): BelongsTo
{
Expand All @@ -147,9 +150,12 @@ public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relat
/**
* Define a one-to-many relationship.
*
* @param string $related
* @template TRelatedModel of \Illuminate\Database\Eloquent\Model
*
* @param class-string<TRelatedModel> $related
* @param string|null $foreignKey
* @param string|null $localKey
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TRelatedModel, $this>
*/
public function hasMany($related, $foreignKey = null, $localKey = null): HasMany
{
Expand All @@ -159,13 +165,16 @@ public function hasMany($related, $foreignKey = null, $localKey = null): HasMany
/**
* Define a many-to-many relationship.
*
* @param string $related
* @param string|null $table
* @template TRelatedModel of \Illuminate\Database\Eloquent\Model
*
* @param class-string<TRelatedModel> $related
* @param string|class-string<\Illuminate\Database\Eloquent\Model>|null $table
* @param string|null $foreignPivotKey
* @param string|null $relatedPivotKey
* @param string|null $parentKey
* @param string|null $relatedKey
* @param string|null $relation
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TRelatedModel, $this>
*/
public function belongsToMany(
$related, $table = null,
Expand Down
Loading