Skip to content

Commit cea122e

Browse files
authored
refactor: update ModelQueryBuilder generics to support static analysis
1 parent d2e8a4e commit cea122e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Tempest/Database/src/Builder/ModelQueryBuilder.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ public function __construct(
3535
$this->modelDefinition = new ModelDefinition($this->modelClass);
3636
}
3737

38-
/** @return TModelClass|null */
39-
public function first(mixed ...$bindings): ?DatabaseModel
38+
/**
39+
* @return TModelClass|null
40+
*/
41+
public function first(mixed ...$bindings)
4042
{
4143
$query = $this->build($bindings);
4244

@@ -49,8 +51,10 @@ public function first(mixed ...$bindings): ?DatabaseModel
4951
return $result[array_key_first($result)];
5052
}
5153

52-
/** @return TModelClass|null */
53-
public function find(Id $id): ?DatabaseModel
54+
/**
55+
* @return TModelClass|null
56+
*/
57+
public function find(Id $id)
5458
{
5559
return $this
5660
->whereField('id', $id)

0 commit comments

Comments
 (0)