From dcd86fa1dfcc7343a4b0ceddbda32ba55b2b440a Mon Sep 17 00:00:00 2001 From: ildyria Date: Wed, 23 Oct 2024 23:46:18 +0200 Subject: [PATCH] formatting --- src/AncestorsRelation.php | 2 +- src/BaseRelation.php | 7 ++++--- src/Collection.php | 2 +- src/DescendantsRelation.php | 2 +- src/QueryBuilder.php | 26 +++++++++++++------------- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/AncestorsRelation.php b/src/AncestorsRelation.php index 7cbfb39..2fabefe 100644 --- a/src/AncestorsRelation.php +++ b/src/AncestorsRelation.php @@ -43,7 +43,7 @@ protected function matches(Model $model, $related): bool /** * @param QueryBuilder $query - * @param NodeModel $model + * @param NodeModel $model * * @return void */ diff --git a/src/BaseRelation.php b/src/BaseRelation.php index ce6d0e5..e263b4d 100644 --- a/src/BaseRelation.php +++ b/src/BaseRelation.php @@ -43,7 +43,7 @@ abstract class BaseRelation extends Relation * AncestorsRelation constructor. * * @param QueryBuilder $builder - * @param NodeModel $model + * @param NodeModel $model */ public function __construct(QueryBuilder $builder, Model $model) { @@ -64,7 +64,7 @@ abstract protected function matches(Model&Node $model, Node $related): bool; /** * @param QueryBuilder $query - * @param NodeModel $model + * @param NodeModel $model * * @return void */ @@ -113,7 +113,7 @@ public function getRelationExistenceQuery(EloquentBuilder $query, EloquentBuilde * Initialize the relation on a set of models. * * @param array $models - * @param string $relation + * @param string $relation * * @return array */ @@ -143,6 +143,7 @@ public function getResults() { /** @var Collection */ $result = $this->query->get(); + return $result; } diff --git a/src/Collection.php b/src/Collection.php index db62be3..d1c1451 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -146,7 +146,7 @@ public function toFlatTree($root = false): Collection * Flatten a tree into a non recursive array. * * @param Collection $groupedNodes - * @param array-key $parentId + * @param array-key $parentId * * @return Collection */ diff --git a/src/DescendantsRelation.php b/src/DescendantsRelation.php index a6b1a7e..2e13bcc 100644 --- a/src/DescendantsRelation.php +++ b/src/DescendantsRelation.php @@ -32,7 +32,7 @@ public function addConstraints() /** * @param QueryBuilder $query - * @param NodeModel $model + * @param NodeModel $model */ protected function addEagerConstraint($query, $model) { diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index 49bceea..2288098 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -31,7 +31,7 @@ class QueryBuilder extends Builder * @since 2.0 * * @param NodeModel $id - * @param bool $required + * @param bool $required * * @return array */ @@ -57,7 +57,7 @@ public function getNodeData(mixed $id, $required = false) * @since 2.0 * * @param NodeModel $id - * @param bool $required + * @param bool $required * * @return array */ @@ -84,8 +84,8 @@ public function whereIsRoot(): QueryBuilder * @since 2.0 * * @param NodeModel $id - * @param bool $andSelf - * @param string $boolean + * @param bool $andSelf + * @param string $boolean * * @return QueryBuilder */ @@ -129,7 +129,7 @@ public function whereAncestorOf(mixed $id, bool $andSelf = false, string $boolea /** * @param NodeModel $id - * @param bool $andSelf + * @param bool $andSelf * * @return QueryBuilder */ @@ -212,9 +212,9 @@ public function orWhereNodeBetween(array $values) * @since 2.0 * * @param ?NodeModel $id - * @param string $boolean - * @param bool $not - * @param bool $andSelf + * @param string $boolean + * @param bool $not + * @param bool $andSelf * * @return QueryBuilder */ @@ -927,7 +927,7 @@ protected function fixNodes(array &$dictionary, $parent = null) /** * @param array $dictionary * @param NodeModel[] $updated - * @param ?NodeModel $parentId + * @param ?NodeModel $parentId * @param int $cut * * @return int @@ -964,8 +964,8 @@ protected static function reorderNodes( * If item data does not contain primary key, new node will be created. * * @param array[] $data - * @param bool $delete Whether to delete nodes that exists but not in the data array - * @param ?NodeModel $root + * @param bool $delete Whether to delete nodes that exists but not in the data array + * @param ?NodeModel $root * * @return int */ @@ -1012,7 +1012,7 @@ public function rebuildTree(array $data, $delete = false, $root = null) } /** - * @param null $root + * @param null $root * @param array[] $data * @param bool $delete * @@ -1027,7 +1027,7 @@ public function rebuildSubtree($root, array $data, $delete = false) * @param array $dictionary * @param array[] $data * @param array $existing - * @param ?NodeModel $parentId + * @param ?NodeModel $parentId */ protected function buildRebuildDictionary(array &$dictionary, array $data,