Skip to content

Conversation

@mousetraps
Copy link
Contributor

PHP_CodeSniffer 3.0 RC4 introduces a breaking change that removes PHPCS from the composer autoloader. This fix adds a bootstrapping step so that we can invoke the autoloader automatically. Tests should pass after this.

Also see

close #321

PHP_CodeSniffer 3.0 RC4 introduces a breaking change that removes PHPCS from the composer autoloader. This fix adds a bootstrapping step so that we can invoke the autoloader automatically.
@codecov
Copy link

codecov bot commented Mar 2, 2017

Codecov Report

Merging #322 into master will decrease coverage by -0.05%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##             master    #322      +/-   ##
===========================================
- Coverage     84.15%   84.1%   -0.05%     
  Complexity      811     811              
===========================================
  Files            59      60       +1     
  Lines          1717    1718       +1     
===========================================
  Hits           1445    1445              
- Misses          272     273       +1
Impacted Files Coverage Δ Complexity Δ
src/bootstrap.php 0% <0%> (ø) 0 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0de7ba8...5fe4272. Read the comment docs.


// PHP_CodeSniffer does not define an autoloader in its composer.json,
// so we must invoke it ourselves.
require __DIR__ . "/../vendor/squizlabs/php_codesniffer/autoload.php";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't it miss to include the "regular" vendor/autoload.php now?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm a bit worried we are coupling ourselves to the CodeSniffer autoloader here. So far, I only had problems with it and passing CodeSniffer a string to format while we already have an AST for the document is less than ideal

Copy link
Contributor Author

@mousetraps mousetraps Mar 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other option is just locking to the RC3 release, which is not broken.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was at the time a reason why I had to depend on the unstable version, it had an important bug fix - maybe it's fixed now in the most recent RC, might be worth to try out

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, just saw that I do not depend on the unstable version anymore:

        "squizlabs/php_codesniffer" : "^3.0",

I wonder how the breaking change got in there then, as preferStable is set?
Anyway, if it fixes it and tests pass I would prefer to lock the most recent version that works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there aren't any stable versions for 3.0 yet (2.x is the current stable version)

@mousetraps
Copy link
Contributor Author

Closing in favor of #324

@mousetraps mousetraps closed this Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatting breaks after most recent PHPCS update

3 participants