25
25
use CodeIgniter \Entity \Cast \URICast ;
26
26
use CodeIgniter \Entity \Exceptions \CastException ;
27
27
use CodeIgniter \I18n \Time ;
28
+ use DateTime ;
28
29
use Exception ;
29
30
use JsonSerializable ;
30
31
use ReturnTypeWillChange ;
@@ -331,11 +332,11 @@ protected function mapProperty(string $key)
331
332
* Converts the given string|timestamp|DateTime|Time instance
332
333
* into the "CodeIgniter\I18n\Time" object.
333
334
*
334
- * @param mixed $value
335
+ * @param DateTime|float|int|string|Time $value
335
336
*
336
337
* @throws Exception
337
338
*
338
- * @return mixed| Time
339
+ * @return Time
339
340
*/
340
341
protected function mutateDate ($ value )
341
342
{
@@ -347,13 +348,13 @@ protected function mutateDate($value)
347
348
* Add ? at the beginning of $type (i.e. ?string) to get NULL
348
349
* instead of casting $value if $value === null
349
350
*
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"
353
354
*
354
355
* @throws CastException
355
356
*
356
- * @return mixed
357
+ * @return array|bool|float|int|object|string|null
357
358
*/
358
359
protected function castAs ($ value , string $ attribute , string $ method = 'get ' )
359
360
{
@@ -447,7 +448,7 @@ public function cast(?bool $cast = null)
447
448
* $this->my_property = $p;
448
449
* $this->setMyProperty() = $p;
449
450
*
450
- * @param mixed |null $value
451
+ * @param array|bool|float|int|object|string |null $value
451
452
*
452
453
* @throws Exception
453
454
*
@@ -495,7 +496,7 @@ public function __set(string $key, $value = null)
495
496
* @throws Exception
496
497
* @params string $key class property
497
498
*
498
- * @return mixed
499
+ * @return array|bool|float|int|object|string|null
499
500
*/
500
501
public function __get (string $ key )
501
502
{
@@ -532,7 +533,7 @@ public function __get(string $key)
532
533
/**
533
534
* Get cast value from the data array.
534
535
*
535
- * @return mixed |null
536
+ * @return array|bool|float|int|object|string |null
536
537
*/
537
538
private function _getCastData (string $ key , array $ data )
538
539
{
0 commit comments