private static function ensurePropertyType($class, $name, $value)
    {
        $isValid = false;
        $info = self::propertyInfo($class, $name);
        $actualType = self::getActualType($value);
        $valid = explode('|', $info['type']);

        foreach ($valid as $check) {
            if ($check !== 'any' && \DTS\eBaySDK\checkPropertyType($check)) {
                if ($check === $actualType || 'array' === $actualType) {
                    return;
                }
                $isValid = false;
            } else {
                $isValid = true;
            }
        }

        if (!$isValid) {
            $expectedType = $info['type'];
            throw new Exceptions\InvalidPropertyTypeException($name, $expectedType, $actualType);
        }
    }