Skip to content

Commit 6d80bec

Browse files
committed
Revert changing method signatures
1 parent afb1373 commit 6d80bec

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/NodeTrait.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ public function newEloquentBuilder($query)
671671
*
672672
* @return QueryBuilder
673673
*/
674-
public function newNestedSetQuery(?string $table = null)
674+
public function newNestedSetQuery($table = null)
675675
{
676676
$builder = $this->usesSoftDelete()
677677
? $this->withTrashed()
@@ -683,7 +683,7 @@ public function newNestedSetQuery(?string $table = null)
683683
/**
684684
* @return QueryBuilder
685685
*/
686-
public function newScopedQuery(?string $table = null)
686+
public function newScopedQuery($table = null)
687687
{
688688
return $this->applyNestedSetScope($this->newQuery(), $table);
689689
}
@@ -693,7 +693,7 @@ public function newScopedQuery(?string $table = null)
693693
*
694694
* @return mixed
695695
*/
696-
public function applyNestedSetScope($query, ?string $table = null)
696+
public function applyNestedSetScope($query, $table = null)
697697
{
698698
if ( ! $scoped = $this->getScopeAttributes()) {
699699
return $query;

src/QueryBuilder.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function ancestorsAndSelf($id, array $columns = [ '*' ])
188188
*
189189
* @return $this
190190
*/
191-
public function whereNodeBetween($values, $boolean = 'and', $not = false, ?Query $query = null)
191+
public function whereNodeBetween($values, $boolean = 'and', $not = false, $query = null)
192192
{
193193
($query ?? $this->query)->whereBetween($this->model->getTable() . '.' . $this->model->getLftName(), $values, $boolean, $not);
194194

@@ -861,7 +861,7 @@ public function isBroken()
861861
*
862862
* @return int The number of changed nodes
863863
*/
864-
public function fixTree(?Model $root = null)
864+
public function fixTree($root = null)
865865
{
866866
$columns = [
867867
$this->model->getKeyName(),
@@ -899,7 +899,7 @@ public function fixSubtree($root)
899899
*
900900
* @return int
901901
*/
902-
protected function fixNodes(array &$dictionary, ?Model $parent = null)
902+
protected function fixNodes(array &$dictionary, $parent = null)
903903
{
904904
$parentId = $parent ? $parent->getKey() : null;
905905
$cut = $parent ? $parent->getLft() + 1 : 1;
@@ -941,7 +941,7 @@ protected function fixNodes(array &$dictionary, ?Model $parent = null)
941941
* @internal param int $fixed
942942
*/
943943
protected static function reorderNodes(
944-
array &$dictionary, array &$updated, null|int|string $parentId = null, $cut = 1
944+
array &$dictionary, array &$updated, $parentId = null, $cut = 1
945945
) {
946946
if ( ! isset($dictionary[$parentId])) {
947947
return $cut;
@@ -973,11 +973,11 @@ protected static function reorderNodes(
973973
* @param array $data
974974
* @param bool $delete Whether to delete nodes that exists but not in the data
975975
* array
976-
* @param ?Model|NodeTrait $root
976+
* @param null $root
977977
*
978978
* @return int
979979
*/
980-
public function rebuildTree(array $data, $delete = false, ?Model $root = null)
980+
public function rebuildTree(array $data, $delete = false, $root = null)
981981
{
982982
if ($this->model->usesSoftDelete()) {
983983
$this->withTrashed();
@@ -1084,7 +1084,7 @@ protected function buildRebuildDictionary(array &$dictionary,
10841084
*
10851085
* @return $this
10861086
*/
1087-
public function applyNestedSetScope(?string $table = null)
1087+
public function applyNestedSetScope($table = null)
10881088
{
10891089
return $this->model->applyNestedSetScope($this, $table);
10901090
}

tests/NodeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function assertTreeNotBroken($table = 'categories')
8282
$this->assertEquals(array('errors' => null), $actual, "The tree structure of $table is broken!");
8383
}
8484

85-
public function dumpTree(?array $items = null)
85+
public function dumpTree($items = null)
8686
{
8787
if ( ! $items) $items = Category::withTrashed()->defaultOrder()->get();
8888

0 commit comments

Comments
 (0)