public function execute()
    {
        $this->phpci->quiet = true;
        $this->phpci->logExecOutput(false);

        foreach ($this->directories as $dir) {
            $this->lintDirectory($dir);
        }

        $this->phpci->quiet = false;
        $this->phpci->logExecOutput(true);

        $errors = 0;
        $warnings = 0;

        foreach ($this->failedPaths as $path) {
            if ($path['type'] == 'error') {
                $errors++;
            } else {
                $warnings++;
            }
        }

        $this->build->storeMeta('phptallint-warnings', $warnings);
        $this->build->storeMeta('phptallint-errors', $errors);
        $this->build->storeMeta('phptallint-data', $this->failedPaths);

        $success = true;

        if ($this->allowed_warnings != -1 && $warnings > $this->allowed_warnings) {
            $success = false;
        }

        if ($this->allowed_errors != -1 && $errors > $this->allowed_errors) {
            $success = false;
        }

        return $success;
    }
public function execute()
    {
        $this->phpci->quiet = true;
        $this->phpci->logExecOutput(false);

        foreach ($this->directories as $dir) {
            $this->lintDirectory($dir);
        }

        $this->phpci->quiet = false;
        $this->phpci->logExecOutput(true);

        $errors = 0;
        $warnings = 0;

        foreach ($this->failedPaths as $path) {
            if ($path['type'] == 'error') {
                $errors++;
            } else {
                $warnings++;
            }
        }

        $this->build->storeMeta('phptallint-warnings', $warnings);
        $this->build->storeMeta('phptallint-errors', $errors);
        $this->build->storeMeta('phptallint-data', $this->failedPaths);

        $success = true;

        if ($this->allowed_warnings != -1 && $warnings > $this->allowed_warnings) {
            $success = false;
        }

        if ($this->allowed_errors != -1 && $errors > $this->allowed_errors) {
            $success = false;
        }

        return $success;
    }
public function execute ( ) { $ this -> phpci -> quiet = true ; $ this -> phpci -> logExecOutput ( false ) ; foreach ( $ this -> directories as $ dir ) { $ this -> lintDirectory ( $ dir ) ; } $ this -> phpci -> quiet = false ; $ this -> phpci -> logExecOutput ( true ) ; $ errors = 0 ; $ warnings = 0 ; foreach ( $ this -> failedPaths as $ path ) { if ( $ path [ 'type' ] == 'error' ) { $ errors ++ ; } else { $ warnings ++ ; } } $ this -> build -> storeMeta ( 'phptallint-warnings' , $ warnings ) ; $ this -> build -> storeMeta ( 'phptallint-errors' , $ errors ) ; $ this -> build -> storeMeta ( 'phptallint-data' , $ this -> failedPaths ) ; $ success = true ; if ( $ this -> allowed_warnings != - 1 && $ warnings > $ this -> allowed_warnings ) { $ success = false ; } if ( $ this -> allowed_errors != - 1 && $ errors > $ this -> allowed_errors ) { $ success = false ; } return $ success ; }
Executes phptal lint
Executes phptal lint