Extract the arguments from the model constructor for display.

@param object $object
@throws \InvalidArgumentException
@return string[]
483700
public static function args($object) : array
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException('Argument must be'
                . ' an object ' . gettype($object) . ' found.');
        }

        $reflector = new ReflectionClass($object);

        $constructor = $reflector->getConstructor();

        if ($constructor instanceof ReflectionMethod) {
            $args = array_column($constructor->getParameters(), 'name');
        } else {
            $args = [];
        }

        return $args;
    }
718647
private static function objectProperties($object): array
    {
        if ($object instanceof Serializable) {
            return ['$' => $object->serialize()];
        }

        $class = get_class($object);
        $properties = [];

        do {
            try {
                $properties += Closure::bind(function () use ($object) {
                    return get_object_vars($object);
                }, null, $class)->__invoke();
            } catch (Throwable $e) {
                return get_object_vars($object);
            }
        } while ($class = get_parent_class($class));

        return method_exists($object, '__sleep')
            ? array_intersect_key($properties, array_flip($object->__sleep()))
            : $properties;
    }
207618
public function extract($object)
    {
        $data = ['name' => $object->getNormalizedName()];
        if ($object->hasParent()) {
            $data['source'] = strval($object->getParent()->getNormalizedName());
        }
        return $data;
    }
1149677
private function extractObjectProperties($object)
    {
        $propertyToValue = [];

        if (method_exists($object, '__sleep')) {
            $properties = $object->__sleep();
            foreach ($properties as $property) {
                $propertyToValue[$property] = $object->$property;
            }

            return $propertyToValue;
        }


        $reflectedProperties = [];
        $ref = new \ReflectionClass($object);
        foreach ($ref->getProperties() as $property) {
            $property->setAccessible(true);
            $propertyToValue[$property->getName()] = $property->getValue($object);
            $reflectedProperties[] = $property->getName();
        }

        $dynamicProperties = array_diff(array_keys(get_object_vars($object)), $reflectedProperties);

        foreach ($dynamicProperties as $property) {
            $propertyToValue[$property] = $object->$property;
        }

        return $propertyToValue;
    }
38802
public function extract($object)
    {
        $pdfConverterHydrator = new PdfConverterHydrator();

        return [
            'responseStatus' => $object->getResponseStatus(),
            'sourceContainer' => $pdfConverterHydrator->extract($object->getSourceContainer()),
            'url' => $object->getUrl(),
        ];
    }
727708
public function transform($object)
    {
        if (null === $object) {
            return;
        }

        if (!(is_array($object) || $object instanceof \Traversable)) {
            throw new \InvalidArgumentException(sprintf(
                'Traversable element expected, %s given',
                is_object($object) ? get_class($object) : gettype($object)
            ));
        }

        $result = [];
        foreach ($object as $key => $item) {
            $result[$key] = $this->transformer->transform($item);
        }

        return $result;
    }
243893
public function extract($object)
    {
        $data = [];
        if ($object->getId() !== null) {
            $data['id'] = $object->getId();
        }
        $data['name'] = $object->getName();
        $data['isdefault'] = $object->isDefault() ? 1 : 0;
        return $data;
    }
340707
public function getUnmappedArray(DataObject $object)
    {
        $output = [];

        foreach ($this->mapping as $unmappedField => $mappedField) {
            if (strpos($mappedField, ':') !== false) {
                list($mappedField, $modifier) = explode(':', $mappedField);
            }

            $output[$unmappedField] = $object->{$mappedField};
        }

        return $output;
    }
41406
public function persistObject($object) : array
    {
        $data = $this->preparePersistChangeSet($object);

        $class = $this->getClassMetadata();

        if (! isset($data[$class->getIdentifier()[0]])) {
            $data[$class->getIdentifier()[0]] = $this->generateNextId($class);
        }

        $this->objects[$data[$class->getIdentifier()[0]]] = $data;

        return $data;
    }
1110283
public function extract($object)
    {
        $data = parent::extract($object);

        foreach ($this->getFreeValuesKeys() as $key) {
            $data[$key] = $object->get($key);
        }

        return $data;
    }
415478
public function extract($object)
    {
        return [
            'newsId'        => $object->getNewsId(),
            'userId'        => $object->getUserId(),
            'title'         => $object->getTitle(),
            'slug'          => $object->getSlug(),
            'content'       => $object->getContent(),
            'description'   => $object->getDescription(),
            'pageHits'      => $object->getPageHits(),
            'image'         => $object->getImage(),
            'layout'        => $object->getLayout(),
            'lead'          => $object->getLead(),
            'dateCreated'   => $this->extractValue('dateCreated', $object->getDateCreated()),
            'dateModified'  => $this->extractValue('dateModified', $object->getDateModified()),
        ];
    }
458029
public static function toArray($object): array
    {
        $array = array();

        $class = get_class($object);

        $methods = get_class_methods($class);

        foreach ($methods as $method) {

            preg_match(' /^(get)(.*?)$/i', $method, $results);

            $pre = $results[1] ?? '';

            $k = $results[2] ?? '';

            $k = strtolower(substr($k, 0, 1)) . substr($k, 1);

            if ($pre == 'get') {

                $array[$k] = $object->$method();
            }
        }
        return array_filter($array);
    }
753929
public function extract($object)
    {
        $data = [
            'group_id' => $object->getGroup()->getId(),
            'name' => $object->getName(),
        ];
        if ($object->getId()) {
            $data['id'] = $object->getId();
        }
        return $data;
    }
258688
public function normalize($object, $format = null, array $context = []): array
    {
        if (!$object instanceof RelationInterface && !$object instanceof ActionInterface) {
            throw new \InvalidArgumentException(sprintf(
                'The normalizer support only "%s" or "%s" but "%s" given.',
                RelationInterface::class,
                ActionInterface::class,
                is_object($object) ? get_class($object) : gettype($object)
            ));
        }

        $data = [
            'href' => $object->getHref()->getPath(),
        ];

        if ($object->getHref()->isTemplated()) {
            $data['templated'] = true;
        }

        if (count($object->getAttributes())) {
            $data['attributes'] = $object->getAttributes();
        }

        return $data;
    }
1213617
public static function readAttributes($object)
    {
        // Bail out if a non-object was passed.
        if (!is_object($object)) {
            throw self::getInvalidArgumentException(1, 'object');
        }

        $reflector = new ReflectionObject($object);
        $result    = [];

        // Iterate over the attributes of the object.
        foreach ($reflector->getProperties() as $attribute) {
            $attribute->setAccessible(true);
            $result[$attribute->getName()] = $attribute->getValue($object);
        }

        return $result;
    }
73461
static private function objToArray(&$object)
    {
        if (is_object($object) && method_exists($object, '__trace')){
            $arr = $object->__trace();
            if (!is_array($arr)) return $arr;
        }else{
            $arr = (array)$object;
        }
        $result = [];
        while (list ($key, $value) = each($arr)){
            $keys = explode("\0", $key);
            $clear_key = $keys[sizeof($keys) - 1];
            $result[$clear_key] = &$arr[$key];
        }
        return $result;
    }
287497
public static function values($object)
    {
        if ($object instanceof \stdClass)
            $object = (array)$object;

        if (is_array($object))
            return array_values($object);

        $result = [];
        static::each($object, function ($item) use (& $result) {
            $result[] = $item;
        });

        return $result;
    }