Logs all errors happened for the URL
@param integer $url
@param array $errors
@return boolean
165124
protected function logErrors($url, array $errors)
    {
        $data = array($url, implode(PHP_EOL, $errors));
        return gplcart_file_csv($this->job['log']['errors'], $data);
    }
990603
public function storeRuleFailed(array $errors)
    {
        $url     = handles('antares::ban_management/rules/datatable');
        $message = trans('antares/ban_management::response.rules.create.db-failed', $errors);

        return $this->redirectWithMessage($url, $message, 'error');
    }
1237285
public function deleteBannedEmailFailed(array $errors)
    {
        $url     = handles('antares::ban_management/bannedemails/datatable');
        $message = trans('antares/ban_management::response.bannedemails.delete.db-failed', $errors);

        return $this->redirectWithMessage($url, $message, 'error');
    }
593435
protected function formatErrors(string $errors)
    {
        $errors = json_decode($errors);
        $output = '';

        foreach ($errors as $error)
            foreach ($error as $message)
                $output .= $message . "\r\n";

        return $output;
    }
321774
protected function outputErrors($errors)
    {
        foreach ($errors as $path => $error) {
            $this->output->writeln($this->color('error', $path . ':'));
            $this->output->writeln($error);
            $this->output->writeln('');
        }
    }
1300487
public function matches($url, array $annotations)
	{
		foreach ( $annotations as $annotation ) {
			if ( preg_match($annotation->regexp, $url) ) {
				return true;
			}
		}

		return false;
	}
540239
public function halt($errors = null)
    {
        // Display errors
        if ($errors) {
            $this->explainer->error($errors);
        }

        $this->fireEvent('halt');
        $this->halted = true;

        if ($this->event) {
            $this->getEvent()->stopPropagation();
        }

        return false;
    }
954637
public function validate($rules = [], $errors = [])
    {
        foreach ($rules as $param => $subRules) {
            $paramValue = $this->getParam($param);
            foreach ($subRules as $key => $rule) {
                $isError = false;
                if (!is_array($rule)) {
                    switch ($rule) {
                        case self::VALIDATE_REQUIRED:
                            if (is_null($paramValue)) {
                                $isError = true;
                            }
                            break;
                        case self::VALIDATE_MOBILE:
                            if (!ValidationHelper::isMobile($paramValue)) {
                                $isError = true;
                            }
                            break;
                    }
                } else {
                    switch ($key) {
                    case self::VALIDATE_ENUM:
                        if (!in_array($paramValue, $rule)) {
                            $isError = true;
                        }
                        break;
                    }
                }
                if ($isError) {
                    $errCode = self::ERROR_INVALID_PARAM;
                    $errMsg = self::errorMsg[self::ERROR_INVALID_PARAM];
                    if (is_array($rule)) {
                        $rule = $key;
                    }
                    if (isset($errors[$param][$rule]['code'])) {
                        $errCode = $errors[$param][$rule]['code'];
                    }
                    if (isset($errors[$param][$rule]['msg'])) {
                        $errMsg = str_replace('{param}', $param, $errors[$param][$rule]['msg']);
                    }
                    throw new ParamException($errMsg, $errCode);
                }
            }
        }
    }
586602
protected function logError($error)
    {
        $code = $error instanceof \ErrorException ? $error->getSeverity() : E_ERROR;
        $level = $this->getLogLevel($code);
        
        $message = sprintf('%s: %s at %s line %s', $this->codeToString($code), $error->getMessage(),
            $error->getFile(), $error->getLine());

        $context = [
            'error' => $error,
            'code' => $code,
            'message' => $error->getMessage(),
            'file' => $error->getFile(),
            'line' => $error->getLine()
        ];

        $this->getLogger()->log($level, $message, $context);
    }
160945
protected function countErrors()
    {
        $count = 0;
        foreach ($this->errors as $url => $errors) {
            $errors = array_filter($errors);
            $count += count($errors);
            $this->logErrors($url, $errors);
        }
        return $count;
    }
1047672
public static function logoutWithUrl($url)
    {
        trigger_error('Function deprecated for cas servers >= 3.3.5.1', E_USER_DEPRECATED);
        phpCAS :: traceBegin();
        if (!is_object(self::$_PHPCAS_CLIENT)) {
            phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
        }
        if (!is_string($url)) {
            phpCAS :: error('type mismatched for parameter $url (should be `string\')');
        }
        self::$_PHPCAS_CLIENT->logout(array ( "url" => $url ));
        // never reached
        phpCAS :: traceEnd();
    }
801391
protected function error($field, $error)
    {
        $this->errors = array_merge_recursive($this->errors, array($field => $error));

        return false;
    }
1201606
public function check($url)
    {
        try {
            $request = new ServerRequest(['url' => $url]);
            $route = Router::parseRequest($request);
            $name = null;
            foreach (Router::routes() as $r) {
                if ($r->match($route)) {
                    $name = isset($r->options['_name']) ? $r->options['_name'] : $r->getName();
                    break;
                }
            }

            unset($route['_matchedRoute']);
            ksort($route);

            $output = [
                ['Route name', 'URI template', 'Defaults'],
                [$name, $url, json_encode($route)]
            ];
            $this->helper('table')->output($output);
            $this->out();
        } catch (MissingRouteException $e) {
            $this->warn("'$url' did not match any routes.");
            $this->out();

            return false;
        }

        return true;
    }
790862
public function validateLogoUrl($url)
    {
        if (empty($url)) {
            return true;
        }

        if (!is_string($url)) {
            $this->addError('url', 'Url must be a string');
            return false;
        }

        if (mb_strlen($url, 'UTF-8') > 255) {
            $this->addError('url', 'Url length has to be less or equal to 255');
            return false;
        }

        if (filter_var($url, FILTER_VALIDATE_URL) === false) {
            $this->addError('url', 'Url must contain protocol and domain name');
            return false;
        }

        return true;
    }
277992
public function response($errors = [])
    {
        $success = true;
        foreach ($errors as $error) {
            if ($error->getLevel() === Error::LEVEL_ERROR) {
                $success = false;
                break;
            }
        }

        return [$success, $errors];
    }
512790
public function setErrors($errors)
    {
        $this->errors = strtolower((string) $errors);

        $message = sprintf("Set errors flag to [%s].", $this->errors);
        $this->log($message, Project::MSG_DEBUG);
    }
727064
public function error($errors = false)
    {
        if ($errors === false) {
            return $this->error;
        } else {
            if (is_array($errors) === true) {
                foreach ($erros as $error) {
                    $this->error($error);
                }
            }
        }
        $this->error[] =(string) $errors;
    }