Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpcs 3.0 refactor #32

Closed
wants to merge 9 commits into from
Closed

Conversation

krukru
Copy link
Contributor

@krukru krukru commented May 4, 2017

Phpcs has just released version 3.0 which breaks BC for custom sniffs.

This is the first stable release of the 3.0 branch, and is a large refactoring of the code base. It breaks backwards compatibility for all custom sniffs and custom reports. An upgrade guide for sniff and report developers is available here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Version-3.0-Upgrade-Guide

This PR updates the version of phpcs to 3.0, adds namespaces and changes some class names to be compatible with the new version. It also adds some tests.

I wasn't really sure whether the namespace should be

namespace PHP_CodeSniffer\Standards\Yii2\Sniffs\Files;

or

namespace Yii2\Sniffs\Files;

I went with the former because tests wouldn't run otherwise and it's also consistent with the way phpcs uses namespaces for their built-in Standards (for example, see https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php)

Any comments?

@samdark
Copy link
Member

samdark commented May 4, 2017

Related to yiisoft/yii2#14100

@samdark
Copy link
Member

samdark commented Aug 1, 2017

yiisoft/yii2#14100 was merged.

@mikk150
Copy link

mikk150 commented Feb 26, 2018

what is the status of this PR?

@samdark
Copy link
Member

samdark commented Feb 26, 2018

Wasn't properly tested/verified. If you want to do it, feel free to.

@razvanphp
Copy link
Contributor

Installing seems to be working...

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
  - Updating squizlabs/php_codesniffer (2.9.1 => 3.2.3): Loading from cache
  - Updating yiisoft/yii2-coding-standards (2.0.3 => dev-phpcs-3.0/refactor ce14ee0):  Checking out ce14ee0211
Writing lock file
Generating autoload files

but the errors like

String "CURRENT_TIMESTAMP" does not require double quotes; use single quotes instead

are gone, so clearly something is wrong. How can I run the tests?

@razvanphp razvanphp mentioned this pull request Sep 2, 2018
@samdark samdark closed this Sep 4, 2018
@krukru krukru deleted the phpcs-3.0/refactor branch September 5, 2018 07:35
@krukru krukru restored the phpcs-3.0/refactor branch February 12, 2019 12:22
@krukru krukru deleted the phpcs-3.0/refactor branch February 12, 2019 12:25
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.

4 participants