Skip to content

Commit 1b65128

Browse files
committed
docs: fix @return types
1 parent 8718696 commit 1b65128

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

system/Common.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function app_timezone(): string
6363
* $foo = cache('bar');
6464
*
6565
* @return CacheInterface|mixed
66+
* @phpstan-return ($key is null ? CacheInterface : mixed)
6667
*/
6768
function cache(?string $key = null)
6869
{
@@ -196,7 +197,7 @@ function command(string $command)
196197
/**
197198
* More simple way of getting config instances from Factories
198199
*
199-
* @return mixed
200+
* @return object|null
200201
*/
201202
function config(string $name, bool $getShared = true)
202203
{
@@ -376,7 +377,7 @@ function dd(...$vars)
376377
*
377378
* @param string|null $default
378379
*
379-
* @return mixed
380+
* @return bool|string|null
380381
*/
381382
function env(string $key, $default = null)
382383
{
@@ -952,7 +953,7 @@ function session(?string $val = null)
952953
*
953954
* @param mixed ...$params
954955
*
955-
* @return mixed
956+
* @return object
956957
*/
957958
function service(string $name, ...$params)
958959
{
@@ -966,7 +967,7 @@ function service(string $name, ...$params)
966967
*
967968
* @param mixed ...$params
968969
*
969-
* @return mixed
970+
* @return object|null
970971
*/
971972
function single_service(string $name, ...$params)
972973
{
@@ -1076,7 +1077,7 @@ function stringify_attributes($attributes, bool $js = false): string
10761077
* If no parameter is passed, it will return the timer instance,
10771078
* otherwise will start or stop the timer intelligently.
10781079
*
1079-
* @return mixed|Timer
1080+
* @return Timer
10801081
*/
10811082
function timer(?string $name = null)
10821083
{

system/Database/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Database
3535
* Parses the connection binds and returns an instance of the driver
3636
* ready to go.
3737
*
38-
* @return mixed
38+
* @return BaseConnection
3939
*
4040
* @throws InvalidArgumentException
4141
*/

0 commit comments

Comments
 (0)