Skip to content

Commit 7a9b487

Browse files
committed
PHPCSDebug: change namespace
* To allow this sniff to be used with PHPCS 2.x in combination with the `PHPCS23Utils` ruleset, this standard should comply with the PHPCS 2.x naming rules, i.e. no additional namespace prefix. * As the `PHPCSStandards` namespace prefix needs to be removed, it makes sense to make the standard name slightly more specific to prevent potential clashes, so renaming the ruleset from `Debug` to `PHPCSDebug`.
1 parent 04556f1 commit 7a9b487

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/phpcs.xml.dist export-ignore
1212
/phpunit.xml.dist export-ignore
1313
/phpunit-bootstrap.php export-ignore
14-
/Debug/Tests export-ignore
14+
/PHPCSDebug/Tests export-ignore
1515

1616
#
1717
# Auto detect text files and perform LF normalization

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ jobs:
5656

5757
# Validate the xml file.
5858
# @link http://xmlsoft.org/xmllint.html
59-
- xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./Debug/ruleset.xml
59+
- xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./PHPCSDebug/ruleset.xml
6060
- xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./PHPCSDev/ruleset.xml
6161

6262
# Check the code-style consistency of the xml files.
63-
- diff -B ./Debug/ruleset.xml <(xmllint --format "./Debug/ruleset.xml")
63+
- diff -B ./PHPCSDebug/ruleset.xml <(xmllint --format "./PHPCSDebug/ruleset.xml")
6464
- diff -B ./PHPCSDev/ruleset.xml <(xmllint --format "./PHPCSDev/ruleset.xml")
6565

6666

Debug/Sniffs/Debug/TokenListSniff.php renamed to PHPCSDebug/Sniffs/Debug/TokenListSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @link https://github.com/PHPCSStandards/PHPCSDevTools
99
*/
1010

11-
namespace PHPCSStandards\Debug\Sniffs\Debug;
11+
namespace PHPCSDebug\Sniffs\Debug;
1212

1313
use PHP_CodeSniffer\Sniffs\Sniff;
1414
use PHP_CodeSniffer\Files\File;

Debug/Tests/Debug/TokenListUnitTest.php renamed to PHPCSDebug/Tests/Debug/TokenListUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
* @link https://github.com/PHPCSStandards/PHPCSDevTools
99
*/
1010

11-
namespace PHPCSStandards\Debug\Tests\Debug;
11+
namespace PHPCSDebug\Tests\Debug;
1212

1313
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
1414

1515
/**
1616
* Unit test class for the TokenList sniff.
1717
*
18-
* @covers PHPCSStandards\Debug\Sniffs\Debug\TokenListSniff
18+
* @covers PHPCSDebug\Sniffs\Debug\TokenListSniff
1919
*
2020
* @since 1.0.0
2121
*/

Debug/Tests/Debug/TokenListZUnitTest.php renamed to PHPCSDebug/Tests/Debug/TokenListZUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
* @link https://github.com/PHPCSStandards/PHPCSDevTools
99
*/
1010

11-
namespace PHPCSStandards\Debug\Tests\Debug;
11+
namespace PHPCSDebug\Tests\Debug;
1212

1313
use PHPUnit\Framework\TestCase;
1414

1515
/**
1616
* Unit test class for the TokenList sniff.
1717
*
18-
* @covers PHPCSStandards\Debug\Sniffs\Debug\TokenListSniff
18+
* @covers PHPCSDebug\Sniffs\Debug\TokenListSniff
1919
*
2020
* @since 1.0.0
2121
*/

Debug/ruleset.xml renamed to PHPCSDebug/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Debug" namespace="PHPCSStandards\Debug" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPCSDebug" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
33

44
<description>Sniffs which can be used as debugging tools for PHPCS developers</description>
55

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ directories One or more specific directories to examine.
115115

116116
### Sniff Debugging
117117

118-
Once this project is installed, you will see a new `Debug` ruleset in the list of installed standards when you run `phpcs -i`.
118+
Once this project is installed, you will see a new `PHPCSDebug` ruleset in the list of installed standards when you run `phpcs -i`.
119119

120-
For now, this standard only contains one sniff: `Debug.Debug.TokenList`.
120+
For now, this standard only contains one sniff: `PHPCSDebug.Debug.TokenList`.
121121
This sniff will display compact, but detailed information about the tokens found in a (test case) file.
122122

123123
This sniff is compatible with PHPCS 3.0+.
@@ -126,11 +126,11 @@ Typical usage:
126126
* Set up a test case file for a new sniff you intend to write.
127127
* Run PHPCS over the test case file using this standard to see a list of the tokens found in the file:
128128
```bash
129-
phpcs ./SniffNameUnitTest.inc --standard=Debug
129+
phpcs ./SniffNameUnitTest.inc --standard=PHPCSDebug
130130
```
131131
* Or use it together with the new sniff you are developing:
132132
```bash
133-
phpcs ./SniffNameUnitTest.inc --standard=YourStandard,Debug --sniffs=YourStandard.Category.NewSniffName,Debug.Debug.TokenList
133+
phpcs ./SniffNameUnitTest.inc --standard=YourStandard,PHPCSDebug --sniffs=YourStandard.Category.NewSniffName,PHPCSDebug.Debug.TokenList
134134
```
135135

136136
The output will look something along the lines of:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
4646
],
4747
"run-tests": [
48-
"@php ./vendor/phpunit/phpunit/phpunit --filter PHPCSStandards ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
48+
"@php ./vendor/phpunit/phpunit/phpunit --filter PHPCSDebug ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
4949
],
5050
"check-complete": [
51-
"@php ./bin/phpcs-check-feature-completeness ./Debug"
51+
"@php ./bin/phpcs-check-feature-completeness ./PHPCSDebug"
5252
]
5353
}
5454
}

0 commit comments

Comments
 (0)