Skip to content

Commit ef04fcf

Browse files
authored
refactor: sidestep PhpStorm warning on @method docblock in Model (#10444)
1 parent e57247f commit ef04fcf

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

system/Model.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
*
4141
* @property-read BaseConnection $db
4242
*
43+
* @phpstan-type WhenCallback callable(BaseBuilder, mixed): mixed
44+
* @phpstan-type WhenDefaultCallback callable(BaseBuilder): mixed
45+
*
46+
* @phpstan-import-type row_array from BaseModel
47+
*
4348
* @method $this groupBy($by, ?bool $escape = null)
4449
* @method $this groupEnd()
4550
* @method $this groupStart()
@@ -78,15 +83,11 @@
7883
* @method $this selectMax(string $select = '', string $alias = '')
7984
* @method $this selectMin(string $select = '', string $alias = '')
8085
* @method $this selectSum(string $select = '', string $alias = '')
81-
* @method $this when($condition, callable $callback, ?callable $defaultCallback = null)
82-
* @method $this whenNot($condition, callable $callback, ?callable $defaultCallback = null)
86+
* @method $this when($condition, WhenCallback $callback, ?WhenDefaultCallback $defaultCallback = null)
87+
* @method $this whenNot($condition, WhenCallback $callback, ?WhenDefaultCallback $defaultCallback = null)
8388
* @method $this where($key, $value = null, ?bool $escape = null)
8489
* @method $this whereIn(?string $key = null, $values = null, ?bool $escape = null)
8590
* @method $this whereNotIn(?string $key = null, $values = null, ?bool $escape = null)
86-
*
87-
* @phpstan-method $this when($condition, callable(BaseBuilder, mixed): mixed $callback, (callable(BaseBuilder): mixed)|null $defaultCallback = null)
88-
* @phpstan-method $this whenNot($condition, callable(BaseBuilder, mixed): mixed $callback, (callable(BaseBuilder): mixed)|null $defaultCallback = null)
89-
* @phpstan-import-type row_array from BaseModel
9091
*/
9192
class Model extends BaseModel
9293
{

0 commit comments

Comments
 (0)