@param AbstractPoint|array $point

@return array
@throws InvalidValueException
350506
protected function validatePointValue($point)
    {
        switch (true) {
            case ($point instanceof AbstractPoint):
                return $point->toArray();
                break;
            case (is_array($point) && count($point) == 2 && is_numeric($point[0]) && is_numeric($point[1])):
                return array_values($point);
                break;
            default:
                throw new InvalidValueException(sprintf('Invalid %s Point value of type "%s"', $this->getType(), (is_object($point) ? get_class($point) : gettype($point))));
        }
    }
703223
public static function allToArray($value)
    {
        if ($value instanceof \Traversable) {
            $value = iterator_to_array($value);
        }

        if (is_object($value)) {
            $value = get_object_vars($value);
        }

        $value = (array) $value;

        foreach ($value as $k => $v) {
            if (!static::isValidValue($v)) {
                throw new \InvalidArgumentException('Value :' . $value . ' is invalid.');
            }
        }

        return $value;
    }
309437
protected function databaseValue($values)
    {
        if ($values instanceof SetValue) {
            $values = $values->toArray();
        } else {
            if (!is_array($values)) {
                throw ODMException::invalidValueForType('Set', ['array', 'SetValue', 'null'], $values);
            }
        }

        if (count($values) === 0) {
            throw ODMException::setsCannotBeEmpty();
        }

        return $values;
    }
527626
public function extract($value)
    {
        if (null === $value) {
            return $this->nullable ? null : [];
        }

        if (is_object($value)) {
            $objectPrototype = $this->getObjectPrototype();
            return $objectPrototype->getHydrator()->extract($value);
        }
                
        if (is_array($value)) {
            return $value;
        }

        throw new Exception\InvalidArgumentException(sprintf(
            'Invalid value: must be null, or an array, or an object: "%s" given',
            is_object($value) ? get_class($value) : gettype($value)
        ));
    }
897550
protected function normalizeValues(array $values, string $property): ?array
    {
        foreach ($values as $key => $value) {
            if (!\is_int($key) || !\is_string($value)) {
                unset($values[$key]);
            }
        }

        if (empty($values)) {
            $this->getLogger()->notice('Invalid filter ignored', [
                'exception' => new InvalidArgumentException(sprintf('At least one value is required, multiple values should be in "%1$s[]=firstvalue&%1$s[]=secondvalue" format', $property)),
            ]);

            return null;
        }

        return array_values($values);
    }
1167909
private function hangulDecompose(int $codePoint): array
    {
        $sIndex = (int) $codePoint - self::sBase;
        if ($sIndex < 0 || $sIndex >= self::sCount) {
            return [$codePoint];
        }

        $result = [
            (int) self::lBase + $sIndex / self::nCount,
            (int) self::vBase + ($sIndex % self::nCount) / self::tCount,
        ];
        $T = intval(self::tBase + $sIndex % self::tCount);
        if ($T != self::tBase) {
            $result[] = $T;
        }

        return $result;
    }
293853
public static function execute($values, ContextInterface $context): array
    {
        assert(is_array($values));

        // let's consider an empty index list as `readable`
        $result = true;

        if (empty($values) === false) {
            $apiClass = $context->getProperties()->getProperty(static::PROPERTY_API_CLASS);

            /** @var FactoryInterface $apiFactory */
            $apiFactory = $context->getContainer()->get(FactoryInterface::class);

            /** @var CrudInterface $api */
            $api = $apiFactory->createApi($apiClass);

            $readIndexes = $api->withIndexesFilter($values)->indexIdentities();

            $result = count($readIndexes) === count($values);
        }

        return $result === true ?
            static::createSuccessReply($values) :
            static::createErrorReply(
                $context,
                $values,
                ErrorCodes::EXIST_IN_DATABASE_MULTIPLE,
                Messages::EXIST_IN_DATABASE_MULTIPLE,
                []
            );
    }
436731
public static function normalize($pointer, array $context = null)
    {
        if (is_object($pointer)) {
            return ['value' => $pointer];
        }
        if (is_string($pointer)) {
            return ['classname' => $pointer];
        }
        if ($pointer === null) {
            return [];
        }
        if ($pointer === false) {
            throw new Disabled('');
        }
        if (!is_array($pointer)) {
            throw new InvalidPointer('invalid pointer type');
        }
        if (!isset($pointer[0])) {
            return $pointer;
        }
        return self::normalizeNumeric($pointer, $context);
    }
990836
public function pay($endpoint, array $payload): Collection
    {
        $payload['appid'] = Support::getInstance()->miniapp_id;

        if ($this->mode === Wechat::MODE_SERVICE) {
            $payload['sub_appid'] = Support::getInstance()->sub_miniapp_id;
            $this->payRequestUseSubAppId = true;
        }

        return parent::pay($endpoint, $payload);
    }
1139178
protected function valPropValues(array $values)
    {
        $validPropertyValues = [];

        // Run through all property values
        /** @var ValueInterface $value */
        foreach ($values as $value) {
            $this->procPropValue($value, $validPropertyValues);
        }

        return $validPropertyValues;
    }
894387
public function getCustomValue($key)
    {
        if (!array_key_exists($key, $this->customValues)) {
            throw InvalidPayloadException::notExistingCustomValue($key);
        }

        return $this->customValues[$key];
    }
283114
public function setValues(array $values)
    {
        foreach ($values as $value) {
            if (false === is_scalar($value)) {
                throw InvalidArgumentException::create(
                    'Non-scalar values (such as %s) are not supported.',
                    gettype($value)
                );
            }
        }

        $this->values = $values;
    }
70928
public function transformPoint(PointInterface $point, PointInterface $origin = null)
    {

        $x = $point->getX();
        $y = $point->getY();

        if ($origin) {

            $x += $origin->getX();
            $y += $origin->getY();
        }

        $x = $this->a * $x + $this->c * $y + $this->tx;
        $y = $this->b * $x + $this->d * $y + $this->ty;

        if ($origin) {

            $x -= $origin->getX();
            $y -= $origin->getY();
        }

        return new Point($x, $y);
    }
860751
public function render(Point $point)
    {
        $formatter = $this->getFormatter();

        return $formatter->renderObjectAssignment($point, $formatter->renderObject('Point', [
            $point->getX(),
            $point->getY(),
        ]));
    }
776626
public static function isAfter( $string, $point )
	{
		$string	= Alg_Time_Converter::complementMonthDate( $string );
		$time	= strtotime( $string );
		if( $time === false )
			throw new InvalidArgumentException( 'Given Date "'.$string.'" could not been parsed.' );
		return $time > $point;
	}
1095938
public function setPoint(PointInterface $point)
    {
        if (isset($this->points[$point->getName()])) {
            throw new \InvalidArgumentException(
                sprintf(
                    'The point %s already exists in the profiler %s.',
                    $point->getName(),
                    $this->name
                )
            );
        }

        // Add it in the lookup table.
        $this->points[$point->getName()] = $point;

        return $this;
    }
690226
public function getPropertiesValues($properties)
    {
        $returnValue = array();
        if(!is_array($properties)){
			throw new common_exception_InvalidArgumentType(__CLASS__, __FUNCTION__, 0, 'array', $properties);
        }
        $returnValue = $this->getImplementation()->getPropertiesValues($this, $properties/*, $last*/);
        return (array) $returnValue;
    }