Skip to content

Commit 989550e

Browse files
committed
Update to PHPCS 4
1 parent 5a8962f commit 989550e

35 files changed

+65
-65
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ jobs:
77
strategy:
88
matrix:
99
php_version:
10-
- 5.6
11-
- 7.0
12-
- 7.1
1310
- 7.2
1411
- 7.3
1512
- 7.4
1613
- 8.0
1714
- 8.1
1815
- 8.2
1916
- 8.3
17+
- 8.4
2018
runs-on: ubuntu-latest
2119
steps:
2220
- name: Check out repository code

Symfony/Sniffs/Commenting/ClassCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ClassCommentSniff extends Sniff
4646
*
4747
* @var array
4848
*/
49-
protected $tags = array(
49+
protected const EXPECTED_TAGS = array(
5050
'category' => array(
5151
'required' => false,
5252
'allow_multiple' => false,

Symfony/Sniffs/Errors/UserDeprecatedSniff.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function register()
3838
{
3939
return array(
4040
T_STRING,
41+
T_NAME_FULLY_QUALIFIED,
4142
);
4243
}
4344

@@ -58,7 +59,9 @@ public function process(File $phpcsFile, $stackPtr)
5859
{
5960
$tokens = $phpcsFile->getTokens();
6061

61-
if ($tokens[$stackPtr]['content'] !== 'trigger_error') {
62+
if ($tokens[$stackPtr]['content'] !== 'trigger_error'
63+
&& $tokens[$stackPtr]['content'] !== '\trigger_error'
64+
) {
6265
return;
6366
}
6467

Symfony/Sniffs/Objects/ObjectInstantiationSniff.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public function process(File $phpcsFile, $stackPtr)
6969
$allowed = array(
7070
T_STRING,
7171
T_NS_SEPARATOR,
72+
T_NAME_FULLY_QUALIFIED,
73+
T_NAME_QUALIFIED,
7274
T_VARIABLE,
7375
T_STATIC,
7476
T_SELF,

Symfony/Sniffs/Whitespace/AssignmentSpacingSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class AssignmentSpacingSniff implements Sniff
4949
*/
5050
public function register()
5151
{
52-
return Tokens::$assignmentTokens;
52+
return Tokens::ASSIGNMENT_TOKENS;
5353

5454
}
5555

Symfony/Sniffs/Whitespace/BinaryOperatorSpacingSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class BinaryOperatorSpacingSniff implements Sniff
4949
*/
5050
public function register()
5151
{
52-
return Tokens::$comparisonTokens;
52+
return Tokens::COMPARISON_TOKENS;
5353

5454
}
5555

Symfony/Tests/Arrays/MultiLineArrayCommaUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace Symfony\Tests\Arrays;
1616

17-
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
17+
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;
1818

1919
/**
2020
* Unit test class for the MultiLineArrayComma sniff.
@@ -30,7 +30,7 @@
3030
* @license http://spdx.org/licenses/MIT MIT License
3131
* @link https://github.com/djoos/Symfony2-coding-standard
3232
*/
33-
class MultiLineArrayCommaUnitTest extends AbstractSniffUnitTest
33+
class MultiLineArrayCommaUnitTest extends AbstractSniffTestCase
3434
{
3535
/**
3636
* Returns the lines where errors should occur.

Symfony/Tests/Classes/MultipleClassesOneFileUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace Symfony\Tests\Classes;
1616

17-
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
17+
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;
1818

1919
/**
2020
* Unit test class for the MultipleClassesOneFileUnitTest sniff.
@@ -30,7 +30,7 @@
3030
* @license http://spdx.org/licenses/MIT MIT License
3131
* @link https://github.com/djoos/Symfony2-coding-standard
3232
*/
33-
class MultipleClassesOneFileUnitTest extends AbstractSniffUnitTest
33+
class MultipleClassesOneFileUnitTest extends AbstractSniffTestCase
3434
{
3535
/**
3636
* Returns the lines where errors should occur.

Symfony/Tests/Classes/PropertyDeclarationUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace Symfony\Tests\Classes;
1616

17-
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
17+
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;
1818

1919
/**
2020
* Unit test class for the PropertyDeclarationUnitTest sniff.
@@ -30,7 +30,7 @@
3030
* @license http://spdx.org/licenses/MIT MIT License
3131
* @link https://github.com/djoos/Symfony2-coding-standard
3232
*/
33-
class PropertyDeclarationUnitTest extends AbstractSniffUnitTest
33+
class PropertyDeclarationUnitTest extends AbstractSniffTestCase
3434
{
3535
/**
3636
* Returns the lines where errors should occur.

Symfony/Tests/Commenting/AnnotationsUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace Symfony\Tests\Commenting;
1616

17-
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
17+
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;
1818

1919
/**
2020
* Unit test class for the AnnotationsUnitTest sniff.
@@ -30,7 +30,7 @@
3030
* @license http://spdx.org/licenses/MIT MIT License
3131
* @link https://github.com/djoos/Symfony2-coding-standard
3232
*/
33-
class AnnotationsUnitTest extends AbstractSniffUnitTest
33+
class AnnotationsUnitTest extends AbstractSniffTestCase
3434
{
3535
/**
3636
* Returns the lines where errors should occur.

0 commit comments

Comments
 (0)