Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Jun 9, 2024
1 parent de43702 commit 0945747
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/AncestorsRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
/**
* @template Tmodelkey
* @template Tmodel of Model
*
*
* @phpstan-type NodeModel Node<Tmodelkey,Tmodel>&Tmodel
*
*
* @disregard P1037
*
*
* @extends BaseRelation<Tmodelkey,Tmodel>
*/
class AncestorsRelation extends BaseRelation
Expand Down Expand Up @@ -44,7 +44,7 @@ protected function matches(Model $model, $related): bool

/**
* @param QueryBuilder<Tmodelkey,Tmodel> $query
* @param NodeModel $model
* @param NodeModel $model
*
* @return void
*/
Expand Down
14 changes: 7 additions & 7 deletions src/BaseRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @template Tmodel of Model
*
* @phpstan-type NodeModel Node<Tmodelkey,Tmodel>&Tmodel
*
*
* @extends Relation<NodeModel>
*
* @property NodeModel $related
Expand Down Expand Up @@ -44,7 +44,7 @@ abstract class BaseRelation extends Relation
* AncestorsRelation constructor.
*
* @param QueryBuilder<Tmodelkey,Tmodel> $builder
* @param NodeModel $model
* @param NodeModel $model
*/
public function __construct(QueryBuilder $builder, Model $model)
{
Expand All @@ -65,7 +65,7 @@ abstract protected function matches(Model&Node $model, Node $related): bool;

/**
* @param QueryBuilder<Tmodelkey,Tmodel> $query
* @param NodeModel $model
* @param NodeModel $model
*
* @return void
*/
Expand All @@ -84,7 +84,7 @@ abstract protected function relationExistenceCondition(string $hash, string $tab
/**
* @param EloquentBuilder<NodeModel> $query
* @param EloquentBuilder<NodeModel> $parentQuery
* @param mixed $columns
* @param mixed $columns
*
* @return QueryBuilder<Tmodelkey,Tmodel>
*/
Expand Down Expand Up @@ -173,9 +173,9 @@ public function addEagerConstraints(array $models)
/**
* Match the eagerly loaded results to their parents.
*
* @param array<int,NodeModel> $models
* @param array<int,NodeModel> $models
* @param EloquentCollection<int,NodeModel> $results
* @param string $relation
* @param string $relation
*
* @return array<int,NodeModel>
*/
Expand All @@ -192,7 +192,7 @@ public function match(array $models, EloquentCollection $results, $relation)
}

/**
* @param NodeModel $model
* @param NodeModel $model
* @param EloquentCollection<int,NodeModel> $results
*
* @return Collection<int,Tmodelkey,Tmodel>
Expand Down
2 changes: 1 addition & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function toFlatTree($root = false): Collection
* Flatten a tree into a non recursive array.
*
* @param Collection<TKey,Tmodelkey,Tmodel> $groupedNodes
* @param Tmodelkey $parentId
* @param Tmodelkey $parentId
*
* @return Collection<TKey,Tmodelkey,Tmodel>
*/
Expand Down
8 changes: 4 additions & 4 deletions src/DescendantsRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
/**
* @template Tmodelkey
* @template Tmodel of Model
*
*
* @phpstan-type NodeModel Node<Tmodelkey,Tmodel>&Tmodel
*
*
* @disregard P1037
*
*
* @extends BaseRelation<Tmodelkey,Tmodel>
*/
class DescendantsRelation extends BaseRelation
Expand All @@ -33,7 +33,7 @@ public function addConstraints()

/**
* @param QueryBuilder<Tmodelkey,Tmodel> $query
* @param NodeModel $model
* @param NodeModel $model
*/
protected function addEagerConstraint($query, $model)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @template Tmodelkey
* @template Tmodel of \Illuminate\Database\Eloquent\Model
*
*
* @phpstan-type NodeModel Node<Tmodelkey,Tmodel>&Tmodel
*/
interface Node
Expand Down Expand Up @@ -152,8 +152,9 @@ public function down(int $amount = 1): bool;

/**
* @since 2.0
*
* @param QueryBuilder<Tmodelkey,Tmodel> $query
*
*
* @return QueryBuilder<Tmodelkey,Tmodel>
*/
public function newEloquentBuilder(QueryBuilder $query): QueryBuilder;
Expand All @@ -162,6 +163,7 @@ public function newEloquentBuilder(QueryBuilder $query): QueryBuilder;
* Get a new base query that includes deleted nodes.
*
* @since 1.1
*
* @param (QueryBuilder<Tmodelkey,Tmodel>)|string|null $table
*
* @return QueryBuilder<Tmodelkey,Tmodel>
Expand Down
16 changes: 8 additions & 8 deletions src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class QueryBuilder extends Builder
* @since 2.0
*
* @param Tmodelkey|NodeModel $id
* @param bool $required
* @param bool $required
*
* @return array<int,int>
*/
Expand All @@ -58,7 +58,7 @@ public function getNodeData(mixed $id, $required = false)
* @since 2.0
*
* @param Tmodelkey|NodeModel $id
* @param bool $required
* @param bool $required
*
* @return array<int,int>
*/
Expand All @@ -85,8 +85,8 @@ public function whereIsRoot(): QueryBuilder
* @since 2.0
*
* @param Tmodelkey|NodeModel $id
* @param bool $andSelf
* @param string $boolean
* @param bool $andSelf
* @param string $boolean
*
* @return QueryBuilder<Tmodelkey,Tmodel>
*/
Expand Down Expand Up @@ -130,7 +130,7 @@ public function whereAncestorOf(mixed $id, bool $andSelf = false, string $boolea

/**
* @param Tmodelkey|NodeModel $id
* @param bool $andSelf
* @param bool $andSelf
*
* @return QueryBuilder<Tmodelkey,Tmodel>
*/
Expand Down Expand Up @@ -213,9 +213,9 @@ public function orWhereNodeBetween(array $values)
* @since 2.0
*
* @param Tmodelkey|NodeModel $id
* @param string $boolean
* @param bool $not
* @param bool $andSelf
* @param string $boolean
* @param bool $not
* @param bool $andSelf
*
* @return QueryBuilder<Tmodelkey,Tmodel>
*/
Expand Down

0 comments on commit 0945747

Please sign in to comment.