@@ -1659,17 +1659,17 @@ 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 $data Data
1662+ * @param object|null $object Object
16631663 * @param bool $onlyChanged Only Changed Property
16641664 * @param bool $recursive If true, inner entities will be cast as array as well
16651665 *
16661666 * @return array Array
16671667 *
16681668 * @throws ReflectionException
16691669 */
1670- protected function objectToArray ($ data , bool $ onlyChanged = true , bool $ recursive = false ): array
1670+ protected function objectToArray ($ object , bool $ onlyChanged = true , bool $ recursive = false ): array
16711671 {
1672- $ properties = $ this ->objectToRawArray ($ data , $ onlyChanged , $ recursive );
1672+ $ properties = $ this ->objectToRawArray ($ object , $ onlyChanged , $ recursive );
16731673
16741674 assert (is_array ($ properties ));
16751675
@@ -1691,20 +1691,20 @@ protected function objectToArray($data, bool $onlyChanged = true, bool $recursiv
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 $data Data
1694+ * @param object|null $object Object
16951695 * @param bool $onlyChanged Only Changed Property
16961696 * @param bool $recursive If true, inner entities will be casted as array as well
16971697 *
16981698 * @return array|null Array
16991699 *
17001700 * @throws ReflectionException
17011701 */
1702- protected function objectToRawArray ($ data , bool $ onlyChanged = true , bool $ recursive = false ): ? array
1702+ protected function objectToRawArray ($ object , bool $ onlyChanged = true , bool $ recursive = false ): array
17031703 {
1704- if (method_exists ($ data , 'toRawArray ' )) {
1705- $ properties = $ data ->toRawArray ($ onlyChanged , $ recursive );
1704+ if (method_exists ($ object , 'toRawArray ' )) {
1705+ $ properties = $ object ->toRawArray ($ onlyChanged , $ recursive );
17061706 } else {
1707- $ mirror = new ReflectionClass ($ data );
1707+ $ mirror = new ReflectionClass ($ object );
17081708 $ props = $ mirror ->getProperties (ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED );
17091709
17101710 $ properties = [];
@@ -1714,7 +1714,7 @@ protected function objectToRawArray($data, bool $onlyChanged = true, bool $recur
17141714 foreach ($ props as $ prop ) {
17151715 // Must make protected values accessible.
17161716 $ prop ->setAccessible (true );
1717- $ properties [$ prop ->getName ()] = $ prop ->getValue ($ data );
1717+ $ properties [$ prop ->getName ()] = $ prop ->getValue ($ object );
17181718 }
17191719 }
17201720
0 commit comments