|
10 | 10 | */
|
11 | 11 |
|
12 | 12 | use CodeIgniter\Cache\CacheInterface;
|
13 |
| -use CodeIgniter\Config\BaseConfig; |
14 | 13 | use CodeIgniter\Config\Factories;
|
15 | 14 | use CodeIgniter\Cookie\Cookie;
|
16 | 15 | use CodeIgniter\Cookie\CookieStore;
|
|
27 | 26 | use CodeIgniter\HTTP\Response;
|
28 | 27 | use CodeIgniter\HTTP\ResponseInterface;
|
29 | 28 | use CodeIgniter\HTTP\URI;
|
30 |
| -use CodeIgniter\Model; |
31 | 29 | use CodeIgniter\Session\Session;
|
32 | 30 | use CodeIgniter\Test\TestLogger;
|
33 | 31 | use Config\App;
|
@@ -202,16 +200,15 @@ function command(string $command)
|
202 | 200 |
|
203 | 201 | if (! function_exists('config')) {
|
204 | 202 | /**
|
205 |
| - * More simple way of getting config instances from Factories |
| 203 | + * Simpler way of getting config instances from Factories |
206 | 204 | *
|
207 |
| - * @template ConfigTemplate of BaseConfig |
| 205 | + * @template T of object |
208 | 206 | *
|
209 |
| - * @param class-string<ConfigTemplate>|string $name |
| 207 | + * @param class-string<T>|non-empty-string $name |
210 | 208 | *
|
211 |
| - * @return ConfigTemplate|null |
212 |
| - * @phpstan-return ($name is class-string<ConfigTemplate> ? ConfigTemplate : object|null) |
| 209 | + * @phpstan-return ($name is class-string<T> ? T : null) |
213 | 210 | */
|
214 |
| - function config(string $name, bool $getShared = true) |
| 211 | + function config(string $name, bool $getShared = true): ?object |
215 | 212 | {
|
216 | 213 | return Factories::config($name, ['getShared' => $getShared]);
|
217 | 214 | }
|
@@ -811,16 +808,15 @@ function log_message(string $level, string $message, array $context = [])
|
811 | 808 |
|
812 | 809 | if (! function_exists('model')) {
|
813 | 810 | /**
|
814 |
| - * More simple way of getting model instances from Factories |
| 811 | + * Simpler way of getting model instances from Factories |
815 | 812 | *
|
816 |
| - * @template ModelTemplate of Model |
| 813 | + * @template T of object |
817 | 814 | *
|
818 |
| - * @param class-string<ModelTemplate>|string $name |
| 815 | + * @param class-string<T>|non-empty-string $name |
819 | 816 | *
|
820 |
| - * @return ModelTemplate|null |
821 |
| - * @phpstan-return ($name is class-string<ModelTemplate> ? ModelTemplate : object|null) |
| 817 | + * @phpstan-return ($name is class-string<T> ? T : null) |
822 | 818 | */
|
823 |
| - function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn = null) |
| 819 | + function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn = null): ?object |
824 | 820 | {
|
825 | 821 | return Factories::models($name, ['getShared' => $getShared], $conn);
|
826 | 822 | }
|
|
0 commit comments