Output test stats. If any errors were written to stderr at any point, then
they will be dumped here.

@param array $errors
@return void
544753
public function onConcurrentRunnerEnd($errors)
    {
        $this->output->writeln(sprintf(' Run time: %s', \PHP_Timer::secondsToTimeString($this->getTime())));
        $errorCount = count($errors);
        if (! $errorCount) {
            return;
        }

        $labels = ['was', 'error'];

        if ($errorCount > 1) {
            $labels = ['were', 'errors'];
        }

        $this->output->writeln('');
        $this->output->writeln($this->color('error', sprintf('There %s %d %s:', $labels[0], $errorCount, $labels[1])));
        $this->outputErrors($errors);
    }
1003190
public static function error(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('error')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::ERROR)) {
                    $adapter->error((new Message(self::ERROR))->setMessages($messages));
                }
            }
        }
    }
278786
public function displayFatal($error)
    {
        $data = array();
        $data['code'] = 0;
        $data['message'] = $error['message'];
        $data['file'] = $error['file'];
        $data['line'] = $error['line'];
        $data['type'] = 'fatal';
        $data = $this->_formatError(debug_backtrace(), $data);

        $this->render('error', $data);
    }
587493
public function errorInTabs($counters) {
		if (empty($this->current_tab) || empty($counters)) {
			return;
		}
		if (!isset($this->errors['tabs'])) {
			$this->errors['tabs'] = [];
		}
		// we need to process errors in a special way
		foreach ($counters as $type => $counter) {
			$current_tab = $this->current_tab;
			do {
				$key = implode('__', $current_tab) . '__' . $type;
				$current_value = array_key_get($this->errors['tabs'], $key);
				if (is_null($current_value)) {
					$current_value = 0;
				}
				array_key_set($this->errors['tabs'], $key, $current_value + $counter);
				array_pop($current_tab);
			} while (count($current_tab) > 0 && $type != 'records');
		}
	}
756921
protected function showErrors($errors)
    {
        $i = 0;
        $this->output->writeln("\nThere was ".count($errors).' errors:');

        foreach ($errors as $filename => $error) {
            $this->output->writeln('<comment>'.++$i.". {$filename}:{$error['line']}".'</comment>');

            $this->output->write($this->getHighlightedCodeSnippet($filename, $error['line']));

            $this->output->writeln("<error> {$error['error']}</error>");
        }
    }
139461
public function errors($exit_on_error = false)
    {
        if (!empty($this->errors)) {

            foreach (gplcart_array_flatten($this->errors) as $error) {
                $this->error($error);
            }

            $this->errors = array();

            if ($exit_on_error) {
                $this->abort(1);
            }
        }
    }
512045
private function error($error) {
        if($this->logErrors) {
            $file = $this->logLocation.'db-errors.txt';
            $current = file_get_contents($file);
            $current .= date('d/m/Y H:i:s')." ERROR: ".$error->getMessage()." on ".$this->sql."\n";
            file_put_contents($file, $current); 
        }
        die($this->displayErrors ? 'ERROR: '.$error->getMessage().' on '.$this->sql : 0);
    }
462070
public function printResults()
    {
        echo $this->getHeader();
        echo $this->getErrors();
        echo $this->getFailures();
        echo $this->getWarnings();
        echo $this->getFooter();
    }
599160
private function setError($error)
    {
        $this->errors[] = $error;
        if ($this->do_debug >= 1) {
            echo '<pre>';
            foreach ($this->errors as $error) {
                print_r($error);
            }
            echo '</pre>';
        }
    }
704300
protected function renderErrors(array $files, OutputInterface $output)
    {
        foreach ($files as $file) {
            $output->writeln('<file>' . $file->getFilename() . '</file>');

            $this->renderMessages($file->getErrors(), $output);

            $output->writeln('');
        }
    }
454095
public function errors(array $errors, $code = 0)
    {
        foreach ($errors as $error) {
            $this->error($error, $code);
        }
    }
1293229
private function formatErrors($errors)
    {
        if ($errors) {
            $errors = trim($errors);

            if (in_array(substr($errors, -1), ['.', '!', '?'], true)) {
                return $errors;
            }

            return $errors.'.';
        }
    }
1275645
protected function outputError($errorNumber, TestInterface $test, $exception)
    {
        $this->output->writeln(sprintf("  %d)%s:", $errorNumber, $test->getTitle()));

        $message = sprintf("     %s", str_replace(PHP_EOL, PHP_EOL . "     ", $exception->getMessage()));
        $this->output->writeln($this->color('error', $message));

        $location = sprintf('     at %s:%d', $exception->getFile(), $exception->getLine());
        $this->output->writeln($location);

        $this->outputTrace($exception->getTrace());
    }
255470
protected function error($message)
    {
        if ($this->output instanceof ConsoleOutputInterface) {
            $this->output->getErrorOutput()->writeln("<error>$message</error>");
        } else {
            $this->output->writeln("<error>$message</error>");
        }
    }
541282
public function writeLegend( array $legend ) : void
	{
		$legendStrings = [];
		foreach ( $legend as $status => $output )
		{
			$legendStrings[] = "{$output} {$status}";
		}

		$this->write( "%s\n\n", implode( ' | ', $legendStrings ) );
	}
1282470
public function setFails(array $fails = null): void
    {
        if (!empty($fails)) {
            foreach ($fails as $fieldName => $fail) {
                $this->fails[$fieldName] = $fail;
            }
        }
    }
118625
private function set_errors( $errors )
    {
        if( count( $errors ) == 0 )
        {
            return;
        }
        
        $errors_array = array();
        foreach( $this->config->get_sections() as $section )
        {
            foreach( $section->get_fields() as $component )
            {
                if( $component instanceof \Amarkal\UI\ValidatableComponentInterface && $errors[$component->get_name()] )
                {
                    $errors_array[] = array(
                        'section'=> $section->get_slug(),
                        'message'=> $errors[$component->get_name()]
                    );
                }
            }
        }
        State::set('errors', $errors_array);
    }