public function execute()
    {
        list($ignore, $standard, $suffixes) = $this->getFlags();

        $phpcs = $this->phpci->findBinary('phpcs');

        $this->phpci->logExecOutput(false);

        $cmd = $phpcs . ' --report=json %s %s %s %s %s "%s"';
        $this->phpci->executeCommand(
            $cmd,
            $standard,
            $suffixes,
            $ignore,
            $this->tab_width,
            $this->encoding,
            $this->phpci->buildPath . $this->path
        );

        $output = $this->phpci->getLastOutput();
        list($errors, $warnings) = $this->processReport($output);

        $this->phpci->logExecOutput(true);

        $success = true;
        $this->build->storeMeta('phpcs-warnings', $warnings);
        $this->build->storeMeta('phpcs-errors', $errors);

        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()
    {
        list($ignore, $standard, $suffixes) = $this->getFlags();

        $phpcs = $this->phpci->findBinary('phpcs');

        $this->phpci->logExecOutput(false);

        $cmd = $phpcs . ' --report=json %s %s %s %s %s "%s"';
        $this->phpci->executeCommand(
            $cmd,
            $standard,
            $suffixes,
            $ignore,
            $this->tab_width,
            $this->encoding,
            $this->phpci->buildPath . $this->path
        );

        $output = $this->phpci->getLastOutput();
        list($errors, $warnings) = $this->processReport($output);

        $this->phpci->logExecOutput(true);

        $success = true;
        $this->build->storeMeta('phpcs-warnings', $warnings);
        $this->build->storeMeta('phpcs-errors', $errors);

        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 ( ) { list ( $ ignore , $ standard , $ suffixes ) = $ this -> getFlags ( ) ; $ phpcs = $ this -> phpci -> findBinary ( 'phpcs' ) ; $ this -> phpci -> logExecOutput ( false ) ; $ cmd = $ phpcs . ' --report=json %s %s %s %s %s "%s"' ; $ this -> phpci -> executeCommand ( $ cmd , $ standard , $ suffixes , $ ignore , $ this -> tab_width , $ this -> encoding , $ this -> phpci -> buildPath . $ this -> path ) ; $ output = $ this -> phpci -> getLastOutput ( ) ; list ( $ errors , $ warnings ) = $ this -> processReport ( $ output ) ; $ this -> phpci -> logExecOutput ( true ) ; $ success = true ; $ this -> build -> storeMeta ( 'phpcs-warnings' , $ warnings ) ; $ this -> build -> storeMeta ( 'phpcs-errors' , $ errors ) ; if ( $ this -> allowed_warnings != - 1 && $ warnings > $ this -> allowed_warnings ) { $ success = false ; } if ( $ this -> allowed_errors != - 1 && $ errors > $ this -> allowed_errors ) { $ success = false ; } return $ success ; }
Runs PHP Code Sniffer in a specified directory, to a specified standard.
Runs PHP Code Sniffer in a specified directory to a specified standard .