@param string             $path
@param \DateTimeInterface $value

@return ErrorInterface[]
16055
private function validateDateTime(string $path, \DateTimeInterface $value): array
    {
        $expectedValue = \DateTime::createFromFormat(
            '!'.$this->format,
            $value->format($this->format),
            $value->getTimezone()
        );

        if ($expectedValue->format('c') !== $value->format('c')) {
            return [
                new Error(
                    $path,
                    'constraint.datetime.format',
                    ['format' => $this->format, 'value' => $value->format('c')]
                ),
            ];
        }

        return [];
    }
1198624
private static function _parseTwoDateTimeStrings($value)
    {
        $dateStrings = explode(',', $value);
        if (count($dateStrings) !== 2)
            return null;

        $timestamps = [];

        foreach ($dateStrings as $dateString) {
            $result = @preg_match('/^\d\d\d\d-\d?\d-\d?\d \d\d:\d\d:\d\d$/', $dateString);
            if ($result !== 1)
                return null;
            $timestamp = strtotime($dateString);
            if ($timestamp === false)
                return null;

            $timestamps[] = $timestamp;
        }
        return $timestamps;
    }
1188690
public function validate(
        string $path,
        $value,
        ValidatorContextInterface $context,
        ValidatorInterface $validator = null
    ) {
        if (null === $value) {
            return [];
        }

        $type = gettype($value);

        if ('object' === $type) {
            if ($value instanceof $this->wishedType) {
                return [];
            }

            return [$this->getInvalidTypeErrorByPathAndType($path, get_class($value))];
        }

        if ($type === $this->wishedType) {
            return [];
        }

        return [$this->getInvalidTypeErrorByPathAndType($path, $type)];
    }
263787
public function visit($value, ?VisitorInterface $subVisitor = null)
    {
        if ($subVisitor === null) {
            throw new RuntimeException('Implementation requires sub-visitor');
        }

        return [
            'id' => $value->getId(),
            'position' => $value->getPosition(),
            'value' => $value->getCmsItem()->getRemoteId(),
            'value_type' => $value->getDefinition()->getValueType(),
            'configuration' => iterator_to_array($this->visitConfiguration($value, $subVisitor)),
        ];
    }
377532
private function inputToNorm($value, string $path)
    {
        if (null === $this->inputTransformer) {
            $this->inputTransformer = $this->fieldConfig->getNormTransformer() ?? false;
        }

        if (false === $this->inputTransformer) {
            if (null !== $value && !is_scalar($value)) {
                $e = new \RuntimeException(
                    sprintf(
                        'Norm value of type %s is not a scalar value or null and not cannot be '.
                        'converted to a string. You must set a NormTransformer for field "%s" with type "%s".',
                        \gettype($value),
                        $this->fieldConfig->getName(),
                        \get_class($this->fieldConfig->getType()->getInnerType())
                    )
                );

                $error = new ConditionErrorMessage(
                    $path,
                    $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                    $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                    $this->fieldConfig->getOption('invalid_message_parameters', []),
                    null,
                    $e
                );

                $this->addError($error);

                return null;
            }

            return '' === $value ? null : $value;
        }

        try {
            return $this->inputTransformer->reverseTransform($value);
        } catch (TransformationFailedException $e) {
            $error = new ConditionErrorMessage(
                $path,
                $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                $this->fieldConfig->getOption('invalid_message_parameters', []),
                null,
                $e
            );

            $this->addError($error);

            return null;
        }
    }
233231
public static function execute($value, ContextInterface $context): array
    {
        if (is_string($value) === true || is_numeric($value) === true) {
            return static::createSuccessReply((int)$value);
        }

        return static::createErrorReply($context, $value, ErrorCodes::IS_INT, Messages::IS_INT, []);
    }
1197702
private function getAssociationPathValue($value, array $path)
    {
        $mapping     = array_shift($path);
        $metadata    = $this->em->getClassMetadata($mapping['class']);
        $association = $metadata->getProperty($mapping['field']);
        $value       = $association->getValue($value);

        if ($value === null) {
            return null;
        }

        if (empty($path)) {
            return $value;
        }

        // Handle *-to-one associations
        if ($association instanceof ToOneAssociationMetadata) {
            return $this->getAssociationPathValue($value, $path);
        }

        $values = [];

        foreach ($value as $item) {
            $values[] = $this->getAssociationPathValue($item, $path);
        }

        return $values;
    }
714002
public static function execute($value, ContextInterface $context): array
    {
        $values = $context->getProperties()->getProperty(static::PROPERTY_VALUES);
        $isOk   = in_array($value, $values);

        return $isOk === true ?
            static::createSuccessReply($value) :
            static::createErrorReply($context, $value, ErrorCodes::INVALID_VALUE, Messages::INVALID_VALUE, []);
    }
838321
public static function createFromInput($value)
    {
        $timestamp = strtotime($value);

        try {
            // trim java ms
            $value = preg_replace('`(\\.[0-9]{3})\\+`', '+', $value);

            $datetime = self::createFromFormat(self::DATE_FORMAT, $value);

            if ($timestamp != $datetime->getTimestamp()) {
                throw new ResponseCode("Invalid datetime with value '$value'", 422);
            }
        } catch (\Exception $exception) {
            throw new ResponseCode("Invalid datetime format with value '$value'", 422);
        }

        return $datetime;
    }
1228727
protected static function _makeDimensional($path, $value){
		$a = [];
		$temp = &$a;
		foreach ( $path as $key ) {
			$temp = &$temp[$key];
		}
		$temp = $value;
		return $a;
	}
1178701
protected function formatDatetime(\DateTimeInterface $value): string
    {
        try {
            $datetime = new \DateTimeImmutable('now', $this->getTimezone());
        } catch (\Exception $e) {
            throw new DriverException($e->getMessage(), $e->getCode(), $e);
        }

        return $datetime->setTimestamp($value->getTimestamp())->format(static::DATETIME);
    }
926868
public function greaterThan(\DateTimeInterface $value)
    {
        $value = $this->processDateTime($value);

        return $this->attr(DateTimeTypeBase::ATTR_GREATER_THAN, $value);
    }
938109
public static function execute($value, ContextInterface $context): array
    {
        $from = new DateTime('tomorrow');
        $to   = new DateTime('+5 days');

        $isValidDeliveryDate = $value instanceof DateTimeInterface === true && $value >= $from && $value <= $to;

        return $isValidDeliveryDate === true ?
            static::createSuccessReply($value) :
            static::createErrorReply(
                $context,
                $value,
                Errors::IS_DELIVERY_DATE,
                static::MESSAGE_TEMPLATE,
                [$from->getTimestamp(), $to->getTimestamp()]
            );
    }
312598
protected function getDateTimestamp($value)
    {
        if ($value instanceof DateTimeInterface) {
            return $value->getTimestamp();
        }

        if ($this->isTestingRelativeDateTime($value)) {
            $date = $this->getDateTime($value);

            if (! is_null($date)) {
                return $date->getTimestamp();
            }
        }

        return strtotime($value);
    }
243533
public function validate(
        string $path,
        $value,
        ValidatorContextInterface $context,
        ValidatorInterface $validator = null
    ) {
        if (null === $value) {
            return [];
        }

        if (!is_array($value) && !$value instanceof \Countable) {
            return [new Error(
                $path,
                'constraint.count.invalidtype',
                ['type' => is_object($value) ? get_class($value) : gettype($value)]
            )];
        }

        $count = count($value);

        if (null !== $this->min && $count < $this->min || null !== $this->max && $count > $this->max) {
            return [
                new Error(
                    $path,
                    'constraint.count.outofrange',
                    ['count' => $count, 'min' => $this->min, 'max' => $this->max]
                ),
            ];
        }

        return [];
    }
884784
protected function getArrayAttributeWithValue($path, $key, $value)
    {
        return array_set($this->getArrayAttributeByKey($key), str_replace('->', '.', $path), $value);
    }
1315828
public static function execute($value, ContextInterface $context): array
    {
        return is_array($value) === true ?
            static::createSuccessReply($value) :
            static::createErrorReply($context, $value, ErrorCodes::IS_ARRAY, Messages::IS_ARRAY, []);
    }