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 ;
@@ -147,7 +148,7 @@ public function fill(?array $data = null)
147
148
*
148
149
* @param bool $onlyChanged If true, only return values that have changed since object creation
149
150
* @param bool $cast If true, properties will be cast.
150
- * @param bool $recursive If true, inner entities will be casted as array as well.
151
+ * @param bool $recursive If true, inner entities will be cast as array as well.
151
152
*/
152
153
public function toArray (bool $ onlyChanged = false , bool $ cast = true , bool $ recursive = false ): array
153
154
{
@@ -189,7 +190,7 @@ public function toArray(bool $onlyChanged = false, bool $cast = true, bool $recu
189
190
* Returns the raw values of the current attributes.
190
191
*
191
192
* @param bool $onlyChanged If true, only return values that have changed since object creation
192
- * @param bool $recursive If true, inner entities will be casted as array as well.
193
+ * @param bool $recursive If true, inner entities will be cast as array as well.
193
194
*/
194
195
public function toRawArray (bool $ onlyChanged = false , bool $ recursive = false ): array
195
196
{
@@ -247,7 +248,7 @@ public function syncOriginal()
247
248
* was created. Or, without a parameter, checks if any
248
249
* properties have changed.
249
250
*
250
- * @param string $key
251
+ * @param string|null $key class property
251
252
*/
252
253
public function hasChanged (?string $ key = null ): bool
253
254
{
@@ -308,11 +309,11 @@ protected function mapProperty(string $key)
308
309
* Converts the given string|timestamp|DateTime|Time instance
309
310
* into the "CodeIgniter\I18n\Time" object.
310
311
*
311
- * @param mixed $value
312
+ * @param DateTime|float|int|string|Time $value
312
313
*
313
314
* @throws Exception
314
315
*
315
- * @return mixed| Time
316
+ * @return Time
316
317
*/
317
318
protected function mutateDate ($ value )
318
319
{
@@ -324,13 +325,13 @@ protected function mutateDate($value)
324
325
* Add ? at the beginning of $type (i.e. ?string) to get NULL
325
326
* instead of casting $value if $value === null
326
327
*
327
- * @param mixed $value Attribute value
328
- * @param string $attribute Attribute name
329
- * @param string $method Allowed to "get" and "set"
328
+ * @param bool|float|int|string|null $value Attribute value
329
+ * @param string $attribute Attribute name
330
+ * @param string $method Allowed to "get" and "set"
330
331
*
331
332
* @throws CastException
332
333
*
333
- * @return mixed
334
+ * @return array|bool|float|int|object|string|null
334
335
*/
335
336
protected function castAs ($ value , string $ attribute , string $ method = 'get ' )
336
337
{
@@ -424,7 +425,7 @@ public function cast(?bool $cast = null)
424
425
* $this->my_property = $p;
425
426
* $this->setMyProperty() = $p;
426
427
*
427
- * @param mixed |null $value
428
+ * @param array|bool|float|int|object|string |null $value
428
429
*
429
430
* @throws Exception
430
431
*
@@ -470,8 +471,9 @@ public function __set(string $key, $value = null)
470
471
* $p = $this->getMyProperty()
471
472
*
472
473
* @throws Exception
474
+ * @params string $key class property
473
475
*
474
- * @return mixed
476
+ * @return array|bool|float|int|object|string|null
475
477
*/
476
478
public function __get (string $ key )
477
479
{
0 commit comments