Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ jobs:
strategy:
matrix:
php_version:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
runs-on: ubuntu-latest
steps:
- name: Check out repository code
Expand Down
9 changes: 0 additions & 9 deletions Symfony/Sniffs/Arrays/MultiLineArrayCommaSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@
*/
class MultiLineArrayCommaSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down
9 changes: 0 additions & 9 deletions Symfony/Sniffs/Classes/MultipleClassesOneFileSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ class MultipleClassesOneFileSniff implements Sniff
*/
protected $currentFile;

/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down
15 changes: 1 addition & 14 deletions Symfony/Sniffs/Classes/PropertyDeclarationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
*/
class PropertyDeclarationSniff implements Sniff
{

/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
Expand All @@ -68,10 +58,7 @@ public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();

$end = null;
if (isset($tokens[$stackPtr]['scope_closer'])) {
$end = $tokens[$stackPtr]['scope_closer'];
}
$end = $tokens[$stackPtr]['scope_closer'] ?? null;

$scope = $phpcsFile->findNext(
T_FUNCTION,
Expand Down
2 changes: 1 addition & 1 deletion Symfony/Sniffs/Commenting/ClassCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ClassCommentSniff extends Sniff
*
* @var array
*/
protected $tags = array(
protected const EXPECTED_TAGS = array(
'category' => array(
'required' => false,
'allow_multiple' => false,
Expand Down
5 changes: 4 additions & 1 deletion Symfony/Sniffs/Errors/UserDeprecatedSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function register()
{
return array(
T_STRING,
T_NAME_FULLY_QUALIFIED,
);
}

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

if ($tokens[$stackPtr]['content'] !== 'trigger_error') {
if ($tokens[$stackPtr]['content'] !== 'trigger_error'
&& $tokens[$stackPtr]['content'] !== '\trigger_error'
) {
return;
}

Expand Down
10 changes: 0 additions & 10 deletions Symfony/Sniffs/Formatting/BlankLineBeforeReturnSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@
*/
class BlankLineBeforeReturnSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
'JS',
);

/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down
16 changes: 1 addition & 15 deletions Symfony/Sniffs/Functions/ScopeOrderSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
*/
class ScopeOrderSniff implements Sniff
{

/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down Expand Up @@ -83,11 +73,7 @@ public function process(File $phpcsFile, $stackPtr)
);

while ($function) {
$end = null;

if (isset($tokens[$stackPtr]['scope_closer'])) {
$end = $tokens[$stackPtr]['scope_closer'];
}
$end = $tokens[$stackPtr]['scope_closer'] ?? null;

$function = $phpcsFile->findNext(
array(
Expand Down
9 changes: 0 additions & 9 deletions Symfony/Sniffs/NamingConventions/ValidClassNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
*/
class ValidClassNameSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down
12 changes: 2 additions & 10 deletions Symfony/Sniffs/Objects/ObjectInstantiationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
*/
class ObjectInstantiationSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);


/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down Expand Up @@ -69,6 +59,8 @@ public function process(File $phpcsFile, $stackPtr)
$allowed = array(
T_STRING,
T_NS_SEPARATOR,
T_NAME_FULLY_QUALIFIED,
T_NAME_QUALIFIED,
T_VARIABLE,
T_STATIC,
T_SELF,
Expand Down
11 changes: 1 addition & 10 deletions Symfony/Sniffs/Whitespace/AssignmentSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,14 @@
*/
class AssignmentSpacingSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return Tokens::$assignmentTokens;
return Tokens::ASSIGNMENT_TOKENS;

}

Expand Down
11 changes: 1 addition & 10 deletions Symfony/Sniffs/Whitespace/BinaryOperatorSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,14 @@
*/
class BinaryOperatorSpacingSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return Tokens::$comparisonTokens;
return Tokens::COMPARISON_TOKENS;

}

Expand Down
9 changes: 0 additions & 9 deletions Symfony/Sniffs/Whitespace/CommaSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
*/
class CommaSpacingSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
);

/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down
12 changes: 0 additions & 12 deletions Symfony/Sniffs/Whitespace/DiscourageFitzinatorSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@
*/
class DiscourageFitzinatorSniff implements Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
'JS',
'CSS',
);


/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down
4 changes: 2 additions & 2 deletions Symfony/Tests/Arrays/MultiLineArrayCommaUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Symfony\Tests\Arrays;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;

/**
* Unit test class for the MultiLineArrayComma sniff.
Expand All @@ -30,7 +30,7 @@
* @license http://spdx.org/licenses/MIT MIT License
* @link https://github.com/djoos/Symfony2-coding-standard
*/
class MultiLineArrayCommaUnitTest extends AbstractSniffUnitTest
class MultiLineArrayCommaUnitTest extends AbstractSniffTestCase
{
/**
* Returns the lines where errors should occur.
Expand Down
4 changes: 2 additions & 2 deletions Symfony/Tests/Classes/MultipleClassesOneFileUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Symfony\Tests\Classes;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;

/**
* Unit test class for the MultipleClassesOneFileUnitTest sniff.
Expand All @@ -30,7 +30,7 @@
* @license http://spdx.org/licenses/MIT MIT License
* @link https://github.com/djoos/Symfony2-coding-standard
*/
class MultipleClassesOneFileUnitTest extends AbstractSniffUnitTest
class MultipleClassesOneFileUnitTest extends AbstractSniffTestCase
{
/**
* Returns the lines where errors should occur.
Expand Down
4 changes: 2 additions & 2 deletions Symfony/Tests/Classes/PropertyDeclarationUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Symfony\Tests\Classes;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;

/**
* Unit test class for the PropertyDeclarationUnitTest sniff.
Expand All @@ -30,7 +30,7 @@
* @license http://spdx.org/licenses/MIT MIT License
* @link https://github.com/djoos/Symfony2-coding-standard
*/
class PropertyDeclarationUnitTest extends AbstractSniffUnitTest
class PropertyDeclarationUnitTest extends AbstractSniffTestCase
{
/**
* Returns the lines where errors should occur.
Expand Down
4 changes: 2 additions & 2 deletions Symfony/Tests/Commenting/AnnotationsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Symfony\Tests\Commenting;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;

/**
* Unit test class for the AnnotationsUnitTest sniff.
Expand All @@ -30,7 +30,7 @@
* @license http://spdx.org/licenses/MIT MIT License
* @link https://github.com/djoos/Symfony2-coding-standard
*/
class AnnotationsUnitTest extends AbstractSniffUnitTest
class AnnotationsUnitTest extends AbstractSniffTestCase
{
/**
* Returns the lines where errors should occur.
Expand Down
4 changes: 2 additions & 2 deletions Symfony/Tests/Commenting/ClassCommentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Symfony\Tests\Commenting;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;

/**
* Unit test class for the ClassCommentUnitTest sniff.
Expand All @@ -30,7 +30,7 @@
* @license http://spdx.org/licenses/MIT MIT License
* @link https://github.com/djoos/Symfony2-coding-standard
*/
class ClassCommentUnitTest extends AbstractSniffUnitTest
class ClassCommentUnitTest extends AbstractSniffTestCase
{
/**
* Returns the lines where errors should occur.
Expand Down
4 changes: 2 additions & 2 deletions Symfony/Tests/Commenting/FunctionCommentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Symfony\Tests\Commenting;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase;

/**
* Unit test class for the FunctionComment sniff.
Expand All @@ -30,7 +30,7 @@
* @license http://spdx.org/licenses/MIT MIT License
* @link https://github.com/djoos/Symfony2-coding-standard
*/
class FunctionCommentUnitTest extends AbstractSniffUnitTest
class FunctionCommentUnitTest extends AbstractSniffTestCase
{
/**
* Returns the lines where errors should occur.
Expand Down
Loading