SqlParser\Utils\CLI::runLint PHP Méthode

runLint() public méthode

public runLint ( )
    public function runLint()
    {
        $params = $this->parseLint();
        if ($params === false) {
            return 1;
        }
        if (isset($params['h'])) {
            $this->usageLint();
            return 0;
        }
        if (isset($params['q'])) {
            $lexer = new Lexer($params['q'], false);
            $parser = new Parser($lexer->list);
            $errors = Error::get(array($lexer, $parser));
            if (count($errors) == 0) {
                return 0;
            }
            $output = Error::format($errors);
            echo implode("\n", $output);
            echo "\n";
            return 10;
        }
        echo "ERROR: Missing parameters!\n";
        $this->usageLint();
        return 1;
    }