system/Validation/Validation.php
public function getErrors(): array
	{
		// If we already have errors, we'll use those.
		// If we don't, check the session to see if any were
		// passed along from a redirect_with_input request.
		if (empty($this->errors) && ! is_cli())
		{
			// Start up the session if it's not already
			if (! isset($_SESSION))
			{
				session();
			}

			if ($errors = session('_ci_validation_errors'))
			{
				$this->errors = unserialize($errors);
			}
		}

		return $this->errors ?? [];
	}
public function getErrors(): array
	{
		// If we already have errors, we'll use those.
		// If we don't, check the session to see if any were
		// passed along from a redirect_with_input request.
		if (empty($this->errors) && ! is_cli())
		{
			// Start up the session if it's not already
			if (! isset($_SESSION))
			{
				session();
			}

			if ($errors = session('_ci_validation_errors'))
			{
				$this->errors = unserialize($errors);
			}
		}

		return $this->errors ?? [];
	}
Returns the array of errors that were encountered during
a run() call. The array should be in the following format:

[
'field1' => 'error message',
'field2' => 'error message',
]

@return array

Excluded from code coverage because that it always run as cli

@codeCoverageIgnore