Skip to content

Commit f73be49

Browse files
committed
Refactor clone method in QueryBuilder to improve type safety with generics
1 parent c3a7637 commit f73be49

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/QueryBuilder.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,14 @@ public function __call($name, $arguments)
8282
return $result;
8383
}
8484

85+
/**
86+
* @return static<TModel>
87+
*/
8588
public function clone(): static
8689
{
87-
return clone $this;
90+
/** @var static<TModel> $cloned */
91+
$cloned = clone $this;
92+
return $cloned;
8893
}
8994

9095
public function __clone()

0 commit comments

Comments
 (0)