Skip to content

Commit eed96bd

Browse files
committed
docs: fix PHPDoc types
1 parent 0fd9827 commit eed96bd

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

system/Entity/Cast/BaseCast.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ abstract class BaseCast implements CastInterface
1919
/**
2020
* Get
2121
*
22-
* @param mixed $value Data
23-
* @param array $params Additional param
22+
* @param array|bool|float|int|object|string|null $value Data
23+
* @param array $params Additional param
2424
*
25-
* @return mixed
25+
* @return array|bool|float|int|object|string|null
2626
*/
2727
public static function get($value, array $params = [])
2828
{
@@ -32,10 +32,10 @@ public static function get($value, array $params = [])
3232
/**
3333
* Set
3434
*
35-
* @param mixed $value Data
36-
* @param array $params Additional param
35+
* @param array|bool|float|int|object|string|null $value Data
36+
* @param array $params Additional param
3737
*
38-
* @return mixed
38+
* @return array|bool|float|int|object|string|null
3939
*/
4040
public static function set($value, array $params = [])
4141
{

system/Entity/Cast/CastInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ interface CastInterface
1919
/**
2020
* Get
2121
*
22-
* @param mixed $value Data
23-
* @param array $params Additional param
22+
* @param array|bool|float|int|object|string|null $value Data
23+
* @param array $params Additional param
2424
*
25-
* @return mixed
25+
* @return array|bool|float|int|object|resource|string|null
2626
*/
2727
public static function get($value, array $params = []);
2828

2929
/**
3030
* Set
3131
*
32-
* @param mixed $value Data
33-
* @param array $params Additional param
32+
* @param array|bool|float|int|object|string|null $value Data
33+
* @param array $params Additional param
3434
*
35-
* @return mixed
35+
* @return array|bool|float|int|object|resource|string|null
3636
*/
3737
public static function set($value, array $params = []);
3838
}

system/Entity/Cast/DatetimeCast.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class DatetimeCast extends BaseCast
2424
* {@inheritDoc}
2525
*
2626
* @throws Exception
27+
*
28+
* @return Time
2729
*/
2830
public static function get($value, array $params = [])
2931
{

system/Entity/Entity.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use CodeIgniter\Entity\Cast\URICast;
2626
use CodeIgniter\Entity\Exceptions\CastException;
2727
use CodeIgniter\I18n\Time;
28+
use DateTime;
2829
use Exception;
2930
use JsonSerializable;
3031
use ReturnTypeWillChange;
@@ -331,11 +332,11 @@ protected function mapProperty(string $key)
331332
* Converts the given string|timestamp|DateTime|Time instance
332333
* into the "CodeIgniter\I18n\Time" object.
333334
*
334-
* @param mixed $value
335+
* @param DateTime|float|int|string|Time $value
335336
*
336337
* @throws Exception
337338
*
338-
* @return mixed|Time
339+
* @return Time
339340
*/
340341
protected function mutateDate($value)
341342
{
@@ -347,13 +348,13 @@ protected function mutateDate($value)
347348
* Add ? at the beginning of $type (i.e. ?string) to get NULL
348349
* instead of casting $value if $value === null
349350
*
350-
* @param mixed $value Attribute value
351-
* @param string $attribute Attribute name
352-
* @param string $method Allowed to "get" and "set"
351+
* @param bool|float|int|string|null $value Attribute value
352+
* @param string $attribute Attribute name
353+
* @param string $method Allowed to "get" and "set"
353354
*
354355
* @throws CastException
355356
*
356-
* @return mixed
357+
* @return array|bool|float|int|object|string|null
357358
*/
358359
protected function castAs($value, string $attribute, string $method = 'get')
359360
{
@@ -447,7 +448,7 @@ public function cast(?bool $cast = null)
447448
* $this->my_property = $p;
448449
* $this->setMyProperty() = $p;
449450
*
450-
* @param mixed|null $value
451+
* @param array|bool|float|int|object|string|null $value
451452
*
452453
* @throws Exception
453454
*
@@ -495,7 +496,7 @@ public function __set(string $key, $value = null)
495496
* @throws Exception
496497
* @params string $key class property
497498
*
498-
* @return mixed
499+
* @return array|bool|float|int|object|string|null
499500
*/
500501
public function __get(string $key)
501502
{
@@ -532,7 +533,7 @@ public function __get(string $key)
532533
/**
533534
* Get cast value from the data array.
534535
*
535-
* @return mixed|null
536+
* @return array|bool|float|int|object|string|null
536537
*/
537538
private function _getCastData(string $key, array $data)
538539
{

0 commit comments

Comments
 (0)