Formats datetime errors.

@return string[]
191967
private function formatDateTimeErrors(array $errors)
    {
        $formattedErrors = [];

        foreach ($errors as $pos => $message) {
            $formattedErrors[] = sprintf('at position %d: %s', $pos, $message);
        }

        return $formattedErrors;
    }
1115271
public function errors() : array
    {
        $errors = $this->privateErrors();
        foreach ((array)$this as $element) {
            if (is_string($element)) {
                continue;
            }
            $name = $element->getElement()->name();
            if ($error = $element->getElement()->errors()) {
                $errors = array_merge($errors, [$name => $error]);
            }
        }
        return $errors;
    }
1070538
public static function getFormats() : array
    {
        return [
            self::FORMAT_GSM => self::FORMAT_GSM,
            self::FORMAT_UNICODE => self::FORMAT_UNICODE,
            self::FORMAT_BINARY => self::FORMAT_BINARY,
            self::FORMAT_WAPPUSH => self::FORMAT_WAPPUSH,
            self::FORMAT_MMS => self::FORMAT_MMS
        ];
    }
1192400
public function getInvalidErrors()
    {
        return array_combine(
            array_keys($this->invalidAttribs),
            array_map(function ($ref) {
                return $ref['error'];
            }, array_values($this->invalidAttribs))
        );
    }
930978
public function getValidationErrors()
    {
        return [
            /** Bundle option related errors */
            __('The options you selected are not available.')->render(),
            __('The required options you selected are not available.')->render(),
            __('Please specify product option(s).')->render(),
            __('Please select all required options.')->render(),
            __('You need to choose options for your item.')->render(),

            /** Input field related errors */
            __('The text is too long.')->render(),
            __('Please specify product\'s required option(s).')
        ];
    }
167516
public function getErrorMessages()
    {
        $errors = [];
        foreach ($this->fields as $field) {
            if ($field instanceof AbstractFormField && !$field->isValid()) {
                $fldErrors = $field->getErrorMessages();
                $errors = array_merge($errors, $fldErrors);
            }
        }

        return $errors;
    }
421983
public function formatDatasets()
    {
        $datasets = Collection::make($this->datasets);

        return json_encode([
            'columns' => Collection::make($this->datasets)
                ->each(function ($dataset) {
                    $dataset->matchValues(count($this->labels));
                })
                ->map(function ($dataset) {
                    return $dataset->format($this->labels);
                })
                ->toArray(),
            'type'  => $datasets->first()->type,
            'types' => $datasets->mapWithKeys(function ($d) {
                return [$d->name => $d->type];
            })->toArray(),
        ]);
    }
262724
public function errorArray()
    {
        $messages = [];
        foreach ($this->failures as $key => $rule) {
            foreach ($rule->getFailures() as $fail) {
                $messages[] = $fail;
            }
        }
        return $messages;
    }
852743
public function getParsedExceptions()
    {
        $parsedExceptions = [];

        $exceptions = $this->getExceptionLinesFromLogFile();
        foreach ($exceptions as $exception) {
            $parsedExceptions[] = str_replace('\\\\', '\\', $exception);
        }

        return $parsedExceptions;
    }
1355187
public function getCommitErrors()
    {
        $errors = array();

        if ($this->_failed_commits) {
            foreach ($this->_failed_commits as $entity) {
                $errors[(string) $entity->getIdentifier()] = array_values($entity->getErrors()->toArray());
            }
        }

        return $errors;
    }
11917
public function getErrors(): array
    {
        if ($this->errors === null) {
            $this->errors = $this->fetchErrors();
        }

        //Making sure that each error point to proper input origin
        return $this->mapper->mapErrors($this, $this->validateNested($this->errors));
    }
1055943
public static function datetimeParts($time = null) : array {
		if (empty($time)) {
			// important to call Format::now function
			$time = self::now('unix');
		}
		if (!is_numeric($time)) {
			$time = strtotime($time);
		}
		return [
			'year' => (int) date('Y', $time),
			'month' => (int) date('m', $time),
			'day' => (int) date('d', $time),
			'hour' => (int) date('H', $time),
			'minute' => (int) date('i', $time),
			'second' => (int) date('s', $time),
			'weekday' => (int) date('w', $time)
		];
	}
1260036
public function getErrorMessages() {
        $messages = array();
        
        foreach($this->entries as $entry) {
            if($entry->isError()) {
                $messages[] = $entry->getMessage();
            }
        }
        
        return $messages;
    }
1165762
public function getCompatibleTimezones()
    {
        $validTimezones = [];
        foreach ($this->dateHelper->getTimezones() as $timezoneID => $timezoneName) {
            if ($this->getDeltaTimezone($timezoneID) === null) {
                $validTimezones[$timezoneID] = $timezoneName;
            }
        }

        return $validTimezones;
    }
940803
public function getErrorList(): array
    {
        $errorList = $this->errorList;
        foreach ($this->fieldResultList as $fieldResult) {
            foreach ($fieldResult->getErrorList() as $error) {
                $errorList[] = $error;
            }
        }

        return $errorList;
    }
36432
public static function getGroupedTimeZones(): array
	{
		$timeZones = [];

		foreach(static::listIdentifiers() as $timeZone)
		{
			[$group, $city] = explode('/', $timeZone, 2) + [null, null];

			$timeZones[$group][$timeZone] = str_replace('_', ' ', $city);
		}

		unset($timeZones['UTC']);

		return $timeZones;
	}
234328
public function getFormats()
    {
        return array(
            Format\HtmlFormat::FORMAT_NAME,
            Format\ConsoleFormat::FORMAT_NAME,
            Format\TextFormat::FORMAT_NAME,
            Format\JsonFormat::FORMAT_NAME,
            Format\XmlFormat::FORMAT_NAME,
            Format\YamlFormat::FORMAT_NAME,
            Format\PhpFormat::FORMAT_NAME
        );
    }