@@ -73,9 +73,9 @@ public static function bootNodeTrait(): void
7373 *
7474 * @param string $action
7575 *
76- * @return Node
76+ * @return self
7777 */
78- protected function setNodeAction ($ action ): Node
78+ protected function setNodeAction ($ action ): self
7979 {
8080 $ this ->pending = func_get_args ();
8181
@@ -400,9 +400,9 @@ public function prependNode(Node $node): bool
400400 *
401401 * @param Node&Tmodel $parent
402402 *
403- * @return Node&Tmodel
403+ * @return self
404404 */
405- public function appendToNode (Node $ parent ): Node
405+ public function appendToNode (Node $ parent ): self
406406 {
407407 return $ this ->appendOrPrependTo ($ parent );
408408 }
@@ -423,9 +423,9 @@ public function prependToNode(Node $parent): Node
423423 * @param Node $parent
424424 * @param bool $prepend
425425 *
426- * @return Node
426+ * @return self
427427 */
428- public function appendOrPrependTo (Node $ parent , bool $ prepend = false )
428+ public function appendOrPrependTo (Node $ parent , bool $ prepend = false ): self
429429 {
430430 $ this ->assertNodeExists ($ parent )
431431 ->assertNotDescendant ($ parent )
@@ -740,7 +740,7 @@ public function newScopedQuery($table = null): NodeQueryBuilder
740740 public function applyNestedSetScope ($ query , $ table = null )
741741 {
742742 $ scoped = $ this ->getScopeAttributes ();
743- if ($ scoped === null || $ scoped === []) {
743+ if ($ scoped === null || $ scoped === []) { /** @phpstan-ignore identical.alwaysFalse */
744744 return $ query ;
745745 }
746746
@@ -855,7 +855,7 @@ public function setParentIdAttribute(mixed $value): void
855855 return ;
856856 }
857857
858- if ($ value !== null && $ value !== 0 && $ value !== '' ) {
858+ if ($ value !== null ) {
859859 $ node = $ this ->newScopedQuery ()->findOrFail ($ value );
860860 $ this ->appendToNode ($ node );
861861 } else {
@@ -1009,7 +1009,7 @@ public function getPrevSiblings(array $columns = ['*'])
10091009 *
10101010 * @return Node
10111011 */
1012- public function getNextSibling (array $ columns = ['* ' ])
1012+ public function getNextSibling (array $ columns = ['* ' ]): Node
10131013 {
10141014 return $ this ->nextSiblings ()->defaultOrder ()->first ($ columns );
10151015 }
@@ -1019,7 +1019,7 @@ public function getNextSibling(array $columns = ['*'])
10191019 *
10201020 * @return Node
10211021 */
1022- public function getPrevSibling (array $ columns = ['* ' ])
1022+ public function getPrevSibling (array $ columns = ['* ' ]): Node
10231023 {
10241024 return $ this ->prevSiblings ()->defaultOrder ('desc ' )->first ($ columns );
10251025 }
@@ -1222,7 +1222,7 @@ protected function assertNodeExists(Node $node)
12221222 protected function assertSameScope (Node $ node ): void
12231223 {
12241224 $ scoped = $ this ->getScopeAttributes ();
1225- if ($ scoped === null || $ scoped === []) {
1225+ if ($ scoped === null || $ scoped === []) { /** @phpstan-ignore identical.alwaysFalse */
12261226 return ;
12271227 }
12281228
0 commit comments