Skip to content

Commit c602c4f

Browse files
committed
docs: fix PHPDoc types
1 parent be70e74 commit c602c4f

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

system/BaseModel.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,9 +1659,9 @@ public function asObject(string $class = 'object')
16591659
* This method uses objectToRawArray() internally and does conversion
16601660
* to string on all Time instances
16611661
*
1662-
* @param object|null $object Object
1663-
* @param bool $onlyChanged Only Changed Property
1664-
* @param bool $recursive If true, inner entities will be cast as array as well
1662+
* @param object $object Object
1663+
* @param bool $onlyChanged Only Changed Property
1664+
* @param bool $recursive If true, inner entities will be cast as array as well
16651665
*
16661666
* @return array Array
16671667
*
@@ -1691,16 +1691,17 @@ protected function objectToArray($object, bool $onlyChanged = true, bool $recurs
16911691
* Takes a class and returns an array of its public and protected
16921692
* properties as an array with raw values.
16931693
*
1694-
* @param object|null $object Object
1695-
* @param bool $onlyChanged Only Changed Property
1696-
* @param bool $recursive If true, inner entities will be casted as array as well
1694+
* @param object $object Object
1695+
* @param bool $onlyChanged Only Changed Property
1696+
* @param bool $recursive If true, inner entities will be casted as array as well
16971697
*
1698-
* @return array|null Array
1698+
* @return array<string, mixed>
16991699
*
17001700
* @throws ReflectionException
17011701
*/
17021702
protected function objectToRawArray($object, bool $onlyChanged = true, bool $recursive = false): array
17031703
{
1704+
// Entity::toRawArray() returns array.
17041705
if (method_exists($object, 'toRawArray')) {
17051706
$properties = $object->toRawArray($onlyChanged, $recursive);
17061707
} else {

system/Model.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,10 @@ public function update($id = null, $data = null): bool
803803
* Takes a class and returns an array of its public and protected
804804
* properties as an array with raw values.
805805
*
806-
* @param object|null $object Object
807-
* @param bool $recursive If true, inner entities will be cast as array as well
806+
* @param object $object Object
807+
* @param bool $recursive If true, inner entities will be cast as array as well
808808
*
809-
* @return array|null Array
809+
* @return array<string, mixed>
810810
*
811811
* @throws ReflectionException
812812
*/

0 commit comments

Comments
 (0)