Skip to content

Commit 7d37c56

Browse files
committed
wip
1 parent 93dad05 commit 7d37c56

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ public function process(File $phpcsFile, $stackPtr): void
177177
private function getUseImport(File $phpcsFile, int $stackPtr)
178178
{
179179
$importTokens = [
180+
T_NAME_FULLY_QUALIFIED,
181+
T_NAME_QUALIFIED,
180182
T_NS_SEPARATOR,
181183
T_STRING,
182184
];

MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class UnnecessaryNamespaceUsageSniff implements Sniff
4545
* @var array<int, int>
4646
*/
4747
private $classNameTokens = [
48+
T_NAME_FULLY_QUALIFIED,
49+
T_NAME_QUALIFIED,
4850
T_NS_SEPARATOR,
4951
T_STRING,
5052
];

MO4/Tests/AbstractMo4SniffUnitTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace MO4\Tests;
1616

1717
use PHP_CodeSniffer\Exceptions\RuntimeException;
18-
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
18+
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;
1919

2020
/**
2121
* Abstract class to make the writing of tests more convenient.
@@ -34,11 +34,11 @@
3434
*
3535
* @link https://github.com/mayflower/mo4-coding-standard
3636
*/
37-
abstract class AbstractMo4SniffUnitTest extends AbstractSniffUnitTest
37+
abstract class AbstractMo4SniffUnitTest extends AbstractSniffTestCase
3838
{
3939
/**
4040
* Array or Array containing the test file as key and as value the key-value pairs with line number and number of#
41-
* errors as describe in @see AbstractSniffUnitTest::getErrorList
41+
* errors as describe in @see AbstractSniffTestCase::getErrorList
4242
*
4343
* When the array is empty, the test will pass.
4444
*
@@ -48,7 +48,7 @@ abstract class AbstractMo4SniffUnitTest extends AbstractSniffUnitTest
4848

4949
/**
5050
* Array or Array containing the test file as key and as value the key-value pairs with line number and number of#
51-
* errors as describe in @see AbstractSniffUnitTest::getWarningList
51+
* errors as describe in @see AbstractSniffTestCase::getWarningList
5252
*
5353
* When the array is empty, the test will pass.
5454
*

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"require": {
2626
"php": "^8.1",
2727
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0",
28-
"escapestudios/symfony2-coding-standard": "^3.16.0",
29-
"slevomat/coding-standard": "^8.14",
30-
"squizlabs/php_codesniffer": "^3.8.0"
28+
"escapestudios/symfony2-coding-standard": "phpcs4-dev",
29+
"slevomat/coding-standard": "phpcs4-dev",
30+
"squizlabs/php_codesniffer": "4.x-dev"
3131
},
3232
"require-dev": {
3333
"ergebnis/composer-normalize": "^2.45",
@@ -47,5 +47,11 @@
4747
"dealerdirect/phpcodesniffer-composer-installer": true,
4848
"ergebnis/composer-normalize": true
4949
}
50+
},
51+
"repositories": [
52+
{
53+
"type": "vcs",
54+
"url": "[email protected]:mmoll/Symfony-coding-standard.git"
5055
}
56+
]
5157
}

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
>
99
<testsuites>
1010
<testsuite name="MO4 Ruleset Test Suite">
11-
<file>vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php</file>
11+
<directory>MO4/Tests</directory>
1212
</testsuite>
1313
</testsuites>
1414
<coverage processUncoveredFiles="false">

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
require_once __DIR__.'/../vendor/squizlabs/php_codesniffer/tests/bootstrap.php';
2323

2424
// Add this Standard.
25-
Config::setConfigData(
25+
(new PHP_CodeSniffer\Config)->setConfigData(
2626
'installed_paths',
2727
__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$myStandardName,
2828
true

0 commit comments

Comments
 (0)