src/Parser/JsonParser.php
private static function actualValue(\stdClass $propertyMeta, $value)
    {
        /**
         * Shortcut. Objects can be assigned as is.
         */
        if (is_object($value)) {
            return $value;
        }

        $types = explode('|', $propertyMeta->phpType);

        foreach ($types as $type) {
            switch ($type) {
                case 'integer':
                case 'string':
                case 'double':
                case 'boolean':
                case 'any':
                    return $value;
                case 'DateTime':
                    return new \DateTime($value, new \DateTimeZone('UTC'));
            }
        }

        $object = new $propertyMeta->phpType();
        self::assignProperties($object, $value);
        return $object;
    }
private static function actualValue(\stdClass $propertyMeta, $value)
    {
        /**
         * Shortcut. Objects can be assigned as is.
         */
        if (is_object($value)) {
            return $value;
        }

        $types = explode('|', $propertyMeta->phpType);

        foreach ($types as $type) {
            switch ($type) {
                case 'integer':
                case 'string':
                case 'double':
                case 'boolean':
                case 'any':
                    return $value;
                case 'DateTime':
                    return new \DateTime($value, new \DateTimeZone('UTC'));
            }
        }

        $object = new $propertyMeta->phpType();
        self::assignProperties($object, $value);
        return $object;
    }
@param \stdClass $propertyMeta The metadata for the property.
@param mixed $value The property value.

@return mixed