JustBlackBird / gulp-phpcs

Gulp plugin for running PHP Code Sniffer
MIT License
47 stars 12 forks source link

bug with new version phpcs 2.3.4 #15

Closed alexander-akait closed 9 years ago

alexander-akait commented 9 years ago

if not use ```javascript stream.resume();

in code:
```javascript
var stream = gulp.src(directory, {
                    cwd: process.cwd()
                })
                    .pipe($.plumber(options.build.plumber))
                    .pipe($.phpcs({
                        bin: phpcsPath,
                        standard: standard,
                        encoding: 'utf-8',
                        colors: true
                    }))
                    .pipe($.phpcs.reporter('log'));

stream.resume();
stream.on('end', done);

then stream silent stop.

JustBlackBird commented 9 years ago

I have a few questions about the problem:

  1. Does gulp-phpcs work for you with an older version of PHPCS?
  2. Does PHPCS work from terminal (without gulp-phpcs)?
  3. Could you please provide the whole gulp task where gulp-phpcs is used?
alexander-akait commented 9 years ago

@JustBlackBird

  1. Yes
  2. Yes
  3. above
JustBlackBird commented 9 years ago

First of all, there is no PHPCS v2.4.3. As I see, the latest version is 2.3.4.

Next, you did not list the minimal test case that illustrates the problem. In your code above there are too many undefined variables (directory, options, standard and so on). So, I've created a test case to trace the problem. Here is the code:

var gulp = require('gulp'),
    phpcs = require('gulp-phpcs');

gulp.task('default', function() {
    return gulp.src(['./test/*.php'])
        .pipe(phpcs({
            bin: './vendor/bin/phpcs',
            standard: 'PSR2',
            encoding: 'utf-8',
            colors: true
        }))
        .pipe(phpcs.reporter('log'));
});

This test case works fine with PHPCS 2.3.4, so I think the problem is outside gulp-phpcs plugin.

alexander-akait commented 9 years ago

@JustBlackBird In the near future I will test again and tell here

JustBlackBird commented 9 years ago

For now I'm closing the issue. If the problem persists and you will be able to provide more details about it it I'll reopen the issue.