Skip to content

Commit 356c0b9

Browse files
authored
Merge pull request #7254 from kenjis/fix-phpdoc-model
docs: improve PHPDoc for model()
2 parents 5726eba + 33a2b64 commit 356c0b9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

system/Common.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,11 +817,12 @@ function log_message(string $level, string $message, array $context = [])
817817
/**
818818
* More simple way of getting model instances from Factories
819819
*
820-
* @template T of Model
820+
* @template ModelTemplate of Model
821821
*
822-
* @param class-string<T> $name
822+
* @param class-string<ModelTemplate>|string $name
823823
*
824-
* @return T
824+
* @return ModelTemplate|null
825+
* @phpstan-return ($name is class-string<ModelTemplate> ? ModelTemplate : object|null)
825826
*/
826827
function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn = null)
827828
{

0 commit comments

Comments
 (0)