@param string $path
@param string $value
@param string $errorType
@param int    $dateTimeErrorCount
@param array  $dateTimeErrors

@return ErrorInterface[]
351771
private function errorsByDateTimeLastErrors(
        string $path,
        string $value,
        string $errorType,
        int $dateTimeErrorCount,
        array $dateTimeErrors
    ): array {
        if (0 === $dateTimeErrorCount) {
            return [];
        }

        $errors = [];
        foreach ($dateTimeErrors as $message) {
            $errors[] = new Error(
                $path,
                sprintf('constraint.datetime.%s', $errorType),
                ['message' => $message, 'format' => $this->format, 'value' => $value]
            );
        }

        return $errors;
    }
587115
public function validateNotBlank($value, $errorMessage, $errorField = null)
    {
        if (Strings::isBlank($value)) {
            $this->error($errorMessage);
            $this->_errorFields[] = $errorField;
        }
    }
183606
protected function convert_to_date_time( $value ) {

		if ( $value instanceof \DateTimeInterface ) {
			return $value;
		}

		switch ( gettype( $value ) ) {
			case 'string' :
				return $this->convert_string( $value );
			case 'integer' :
				return $this->convert_integer( $value );
			case 'double' :
				return $this->convert_double( $value );
			case 'array' :
				return $this->convert_array( $value );
		}

		$this->error_code = Error\ErrorLoggerInterface::INVALID_TYPE_NON_DATE;

		return FALSE;
	}
786956
public function uploadErrors($value, $options = []) {
		$defaults = [
			'allowNoFileError' => true
		];
		if (is_array($options)) {
			$options = array_merge($defaults, $options);
		} else {
			$options = $defaults;
		}
		if (isset($value['error']) && ($value['error'] !== null)) {
			switch ($value['error']) {
				case UPLOAD_ERR_OK:
					return true;
				case UPLOAD_ERR_INI_SIZE:
					$this->_uploadError = __d('file_storage', 'The uploaded file exceeds limit of %s.', Number::toReadableSize(ini_get('upload_max_filesize')));

					return false;
				case UPLOAD_ERR_FORM_SIZE:
					$this->_uploadError = __d('file_storage', 'The uploaded file is to big, please choose a smaller file or try to compress it.');

					return false;
				case UPLOAD_ERR_PARTIAL:
					$this->_uploadError = __d('file_storage', 'The uploaded file was only partially uploaded.');

					return false;
				case UPLOAD_ERR_NO_FILE:
					if ($options['allowNoFileError'] === false) {
						$this->_uploadError = __d('file_storage', 'No file was uploaded.');

						return false;
					}

					return true;
				case UPLOAD_ERR_NO_TMP_DIR:
					$this->_uploadError = __d('file_storage', 'The remote server has no temporary folder for file uploads. Please contact the site admin.');

					return false;
				case UPLOAD_ERR_CANT_WRITE:
					$this->_uploadError = __d('file_storage', 'Failed to write file to disk. Please contact the site admin.');

					return false;
				case UPLOAD_ERR_EXTENSION:
					$this->_uploadError = __d('file_storage', 'File upload stopped by extension. Please contact the site admin.');

					return false;
				default:
					$this->_uploadError = __d('file_storage', 'Unknown File Error. Please contact the site admin.');

					return false;
			}

			return false;
		}
		$this->_uploadError = '';

		return true;
	}
1373737
protected function makeComparable($value, $parameter)
    {

        if (!$value instanceof DateTimeInterface && !$parameter instanceof DateTimeInterface) {
            return [$this->getSize($value), $parameter];
        }

        // One is datetime
        try {
            $value = $this->toTimestamp($value);
            $parameter = $this->toTimestamp($parameter);
            return [$value, $parameter];
        } catch (InvalidArgumentException $e) {
            return [];
        }

    }
1205618
public function getValidationErrors($value)
	{
		$errors = array();
		if($this->required===true and !$value)
		{
			$errors['required'] = 'this element is required';
		}
		if(isset($this->defaultValue) and !empty($this->readonly) and $value!=$this->defaultValue)
		{
			$errors['readonly'] = 'this element is readonly';
		}
		return $errors;
	}
273087
public static function getDateTime($value) : DateTimeInterface
    {
        $datetime  = false;
        $exception = null;

        if ($value instanceof DateTimeInterface) {
            return $value;
        } elseif ($value instanceof UTCDateTime) {
            $datetime = $value->toDateTime();
            $datetime->setTimezone(new DateTimeZone(date_default_timezone_get()));
        } elseif (is_numeric($value)) {
            $value         = (float) $value;
            $seconds       = (int) $value;
            $microseconds  = abs(round($value - $seconds, 6));
            $microseconds *= 1000000;

            $datetime = static::craftDateTime($seconds, (int) $microseconds);
        } elseif (is_string($value)) {
            try {
                $datetime = new DateTime($value);
            } catch (Throwable $e) {
                $exception = $e;
            }
        }

        if ($datetime === false) {
            throw new InvalidArgumentException(sprintf('Could not convert %s to a date value', is_scalar($value) ? '"' . $value . '"' : gettype($value)), 0, $exception);
        }

        return $datetime;
    }
597235
protected static function createErrorInfoEntry(
        int $blockId,
        $value,
        int $code,
        string $messageTemplate,
        array $messageParams
    ): array {
        return [
            static::ERROR_INFO_BLOCK_INDEX        => $blockId,
            static::ERROR_INFO_VALUE              => $value,
            static::ERROR_INFO_CODE               => $code,
            static::ERROR_INFO_MESSAGE_TEMPLATE   => $messageTemplate,
            static::ERROR_INFO_MESSAGE_PARAMETERS => $messageParams,
        ];
    }
579754
public function getValidationErrors($value)
	{
		$errors = array();
		if($this->required===true and !isset($value))
		{
			$errors['required'] = 'this element is required';
		}
		if(isset($this->min) and $this->min>0 and $value<$this->min)
		{
			$errors['min'] = json_encode(array(
				'msg' => "minimum value is %s",
				'arguments' => array($this->min)
			));
		}
		if(isset($this->max) and $this->max>0 and $value>$this->max)
		{
			$errors['max'] = json_encode(array(
				'msg' => "maximum value is $s",
				'arguments' => array($this->max)
			));
		}
		if(isset($this->regex) and !preg_match($this->regex, $value))
		{
			$errors['pattern'] = 'value does not match the pattern';
		}
		if(isset($this->defaultValue) and !empty($this->readonly) and $value!=$this->defaultValue)
		{
			$errors['readonly'] = 'this element is readonly';
		}
		return $errors;
	}
77767
public function set(string $path, $value): void
    {
        if (!empty($path)) {
            $at = & $this->items;
            $keys = $this->explode($path);

            while (count($keys) > 0) {
                if (count($keys) === 1) {
                    if (!is_array($at)) {
                        throw new RuntimeException('Can not set value at this path ['.$path.'] because is not array.');
                    }
                    $at[array_shift($keys)] = $value;
                } else {
                    $key = array_shift($keys);
                    if (!isset($at[$key])) {
                        $at[$key] = [];
                    }
                    $at =& $at[$key];
                }
            }
        } else {
            $this->items = [$value];
        }
    }
1153954
public static function convertToPhp($value)
    {
        if (!is_array($value)) {
            return [];
        }

        // see DateType::convertToPHPValue()
        $convertor = function ($value) {
            try {
                return DateType::getDateTime($value);
            } catch (\InvalidArgumentException $e) {
                return null;
            }
        };

        return array_values(array_filter(array_map($convertor, $value)));
    }
91237
function ValidatorError (path, type) {
  var msg = type
    ? '"' + type + '" '
    : '';
  NeopreneError.call(this, 'Validator ' + msg + 'failed for path ' + path);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'ValidatorError';
  this.path = path;
  this.type = type;
}
1182622
public static function getErrorMessageMissingPermissions($path)
    {
        $message = "Please check that the web server has enough permission to write to these files/directories:<br />";

        if (SettingsServer::isWindows()) {
            $message .= "On Windows, check that the folder is not read only and is writable.\n
						You can try to execute:<br />";
        } else {
            $message .= "For example, on a GNU/Linux server if your Apache httpd user is "
                        . Common::sanitizeInputValue(self::getUser())
                        . ", you can try to execute:<br />\n"
                        . "<code>chown -R ". Common::sanitizeInputValue(self::getUserAndGroup()) ." " . Common::sanitizeInputValue($path) . "</code><br />";
        }

        $message .= self::getMakeWritableCommand($path);

        return $message;
    }
1074526
public function validate(
        string $path,
        $value,
        ValidatorContextInterface $context,
        ValidatorInterface $validator = null
    ) {
        $callback = $this->callback;

        return $callback($path, $value, $context, $validator);
    }
440565
protected function checkObject(&$value, $schema = null, JsonPointer $path = null, $properties = null,
        $additionalProperties = null, $patternProperties = null, $appliedDefaults = array())
    {
        $validator = $this->factory->createInstanceFor('object');
        $validator->check($value, $schema, $path, $properties, $additionalProperties, $patternProperties, $appliedDefaults);

        $this->addErrors($validator->getErrors());
    }
1125835
public function setError(int $type, string $message, string $file, int $line, string $class, array $trace = [])  : array
    {
        return $this->errors = [
            'type'    => $type,
            'message' => $message,
            'file'    => $file,
            'line'    => $line,
            'class'   => $class,
            'trace'   => $trace,
        ];
    }
887696
public List<CsvFieldError> getFieldErrors(final String path) {
        ArgUtils.notEmpty(path, "path");
        
        final List<CsvFieldError> list = new ArrayList<CsvFieldError>();
        for(CsvError item : this.errors) {
            if(item instanceof CsvFieldError && isMatchingFieldError(path, (CsvFieldError) item)) {
                list.add((CsvFieldError) item);
            }
        }
        
        return list;
    }