diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 565c26d..bb97493 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,6 @@ jobs: strategy: matrix: php_version: - - 5.6 - - 7.0 - - 7.1 - 7.2 - 7.3 - 7.4 @@ -17,6 +14,7 @@ jobs: - 8.1 - 8.2 - 8.3 + - 8.4 runs-on: ubuntu-latest steps: - name: Check out repository code diff --git a/Symfony/Sniffs/Arrays/MultiLineArrayCommaSniff.php b/Symfony/Sniffs/Arrays/MultiLineArrayCommaSniff.php index 27b32dd..029f591 100644 --- a/Symfony/Sniffs/Arrays/MultiLineArrayCommaSniff.php +++ b/Symfony/Sniffs/Arrays/MultiLineArrayCommaSniff.php @@ -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. * diff --git a/Symfony/Sniffs/Classes/MultipleClassesOneFileSniff.php b/Symfony/Sniffs/Classes/MultipleClassesOneFileSniff.php index 2c140fe..d38419d 100644 --- a/Symfony/Sniffs/Classes/MultipleClassesOneFileSniff.php +++ b/Symfony/Sniffs/Classes/MultipleClassesOneFileSniff.php @@ -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. * diff --git a/Symfony/Sniffs/Classes/PropertyDeclarationSniff.php b/Symfony/Sniffs/Classes/PropertyDeclarationSniff.php index 1dd0d8b..c74e948 100644 --- a/Symfony/Sniffs/Classes/PropertyDeclarationSniff.php +++ b/Symfony/Sniffs/Classes/PropertyDeclarationSniff.php @@ -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. * @@ -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, diff --git a/Symfony/Sniffs/Commenting/ClassCommentSniff.php b/Symfony/Sniffs/Commenting/ClassCommentSniff.php index f9b8761..a4f6984 100644 --- a/Symfony/Sniffs/Commenting/ClassCommentSniff.php +++ b/Symfony/Sniffs/Commenting/ClassCommentSniff.php @@ -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, diff --git a/Symfony/Sniffs/Errors/UserDeprecatedSniff.php b/Symfony/Sniffs/Errors/UserDeprecatedSniff.php index 5a84d14..88fcfe4 100644 --- a/Symfony/Sniffs/Errors/UserDeprecatedSniff.php +++ b/Symfony/Sniffs/Errors/UserDeprecatedSniff.php @@ -38,6 +38,7 @@ public function register() { return array( T_STRING, + T_NAME_FULLY_QUALIFIED, ); } @@ -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; } diff --git a/Symfony/Sniffs/Formatting/BlankLineBeforeReturnSniff.php b/Symfony/Sniffs/Formatting/BlankLineBeforeReturnSniff.php index 8773d59..930fd94 100644 --- a/Symfony/Sniffs/Formatting/BlankLineBeforeReturnSniff.php +++ b/Symfony/Sniffs/Formatting/BlankLineBeforeReturnSniff.php @@ -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. * diff --git a/Symfony/Sniffs/Functions/ScopeOrderSniff.php b/Symfony/Sniffs/Functions/ScopeOrderSniff.php index 15346e7..5b1d634 100644 --- a/Symfony/Sniffs/Functions/ScopeOrderSniff.php +++ b/Symfony/Sniffs/Functions/ScopeOrderSniff.php @@ -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. * @@ -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( diff --git a/Symfony/Sniffs/NamingConventions/ValidClassNameSniff.php b/Symfony/Sniffs/NamingConventions/ValidClassNameSniff.php index 2212248..8fe9131 100644 --- a/Symfony/Sniffs/NamingConventions/ValidClassNameSniff.php +++ b/Symfony/Sniffs/NamingConventions/ValidClassNameSniff.php @@ -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. * diff --git a/Symfony/Sniffs/Objects/ObjectInstantiationSniff.php b/Symfony/Sniffs/Objects/ObjectInstantiationSniff.php index 39ff7ae..1d87108 100644 --- a/Symfony/Sniffs/Objects/ObjectInstantiationSniff.php +++ b/Symfony/Sniffs/Objects/ObjectInstantiationSniff.php @@ -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. * @@ -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, diff --git a/Symfony/Sniffs/Whitespace/AssignmentSpacingSniff.php b/Symfony/Sniffs/Whitespace/AssignmentSpacingSniff.php index 2541fa4..8224069 100644 --- a/Symfony/Sniffs/Whitespace/AssignmentSpacingSniff.php +++ b/Symfony/Sniffs/Whitespace/AssignmentSpacingSniff.php @@ -33,15 +33,6 @@ */ 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. * @@ -49,7 +40,7 @@ class AssignmentSpacingSniff implements Sniff */ public function register() { - return Tokens::$assignmentTokens; + return Tokens::ASSIGNMENT_TOKENS; } diff --git a/Symfony/Sniffs/Whitespace/BinaryOperatorSpacingSniff.php b/Symfony/Sniffs/Whitespace/BinaryOperatorSpacingSniff.php index 26f44e2..317fe36 100644 --- a/Symfony/Sniffs/Whitespace/BinaryOperatorSpacingSniff.php +++ b/Symfony/Sniffs/Whitespace/BinaryOperatorSpacingSniff.php @@ -33,15 +33,6 @@ */ 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. * @@ -49,7 +40,7 @@ class BinaryOperatorSpacingSniff implements Sniff */ public function register() { - return Tokens::$comparisonTokens; + return Tokens::COMPARISON_TOKENS; } diff --git a/Symfony/Sniffs/Whitespace/CommaSpacingSniff.php b/Symfony/Sniffs/Whitespace/CommaSpacingSniff.php index 56b644d..b351b43 100644 --- a/Symfony/Sniffs/Whitespace/CommaSpacingSniff.php +++ b/Symfony/Sniffs/Whitespace/CommaSpacingSniff.php @@ -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. * diff --git a/Symfony/Sniffs/Whitespace/DiscourageFitzinatorSniff.php b/Symfony/Sniffs/Whitespace/DiscourageFitzinatorSniff.php index f8f9100..5d03fe9 100644 --- a/Symfony/Sniffs/Whitespace/DiscourageFitzinatorSniff.php +++ b/Symfony/Sniffs/Whitespace/DiscourageFitzinatorSniff.php @@ -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. * diff --git a/Symfony/Tests/Arrays/MultiLineArrayCommaUnitTest.php b/Symfony/Tests/Arrays/MultiLineArrayCommaUnitTest.php index e498471..872e058 100644 --- a/Symfony/Tests/Arrays/MultiLineArrayCommaUnitTest.php +++ b/Symfony/Tests/Arrays/MultiLineArrayCommaUnitTest.php @@ -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. @@ -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. diff --git a/Symfony/Tests/Classes/MultipleClassesOneFileUnitTest.php b/Symfony/Tests/Classes/MultipleClassesOneFileUnitTest.php index 363637a..1cbc0c9 100644 --- a/Symfony/Tests/Classes/MultipleClassesOneFileUnitTest.php +++ b/Symfony/Tests/Classes/MultipleClassesOneFileUnitTest.php @@ -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. @@ -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. diff --git a/Symfony/Tests/Classes/PropertyDeclarationUnitTest.php b/Symfony/Tests/Classes/PropertyDeclarationUnitTest.php index ca433b4..44f2fd2 100644 --- a/Symfony/Tests/Classes/PropertyDeclarationUnitTest.php +++ b/Symfony/Tests/Classes/PropertyDeclarationUnitTest.php @@ -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. @@ -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. diff --git a/Symfony/Tests/Commenting/AnnotationsUnitTest.php b/Symfony/Tests/Commenting/AnnotationsUnitTest.php index 8b5da09..55e9306 100644 --- a/Symfony/Tests/Commenting/AnnotationsUnitTest.php +++ b/Symfony/Tests/Commenting/AnnotationsUnitTest.php @@ -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. @@ -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. diff --git a/Symfony/Tests/Commenting/ClassCommentUnitTest.php b/Symfony/Tests/Commenting/ClassCommentUnitTest.php index 675e1c6..216703c 100644 --- a/Symfony/Tests/Commenting/ClassCommentUnitTest.php +++ b/Symfony/Tests/Commenting/ClassCommentUnitTest.php @@ -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. @@ -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. diff --git a/Symfony/Tests/Commenting/FunctionCommentUnitTest.php b/Symfony/Tests/Commenting/FunctionCommentUnitTest.php index f5df782..d8f0af1 100644 --- a/Symfony/Tests/Commenting/FunctionCommentUnitTest.php +++ b/Symfony/Tests/Commenting/FunctionCommentUnitTest.php @@ -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. @@ -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. diff --git a/Symfony/Tests/Commenting/LicenseUnitTest.php b/Symfony/Tests/Commenting/LicenseUnitTest.php index d56a7c0..010def1 100644 --- a/Symfony/Tests/Commenting/LicenseUnitTest.php +++ b/Symfony/Tests/Commenting/LicenseUnitTest.php @@ -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 LicenseUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class LicenseUnitTest extends AbstractSniffUnitTest +class LicenseUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Commenting/TypeHintingUnitTest.php b/Symfony/Tests/Commenting/TypeHintingUnitTest.php index 4a95fd1..ea24fab 100644 --- a/Symfony/Tests/Commenting/TypeHintingUnitTest.php +++ b/Symfony/Tests/Commenting/TypeHintingUnitTest.php @@ -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 TypeHintingUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class TypeHintingUnitTest extends AbstractSniffUnitTest +class TypeHintingUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/ControlStructure/IdenticalComparisonUnitTest.php b/Symfony/Tests/ControlStructure/IdenticalComparisonUnitTest.php index 700c6c3..102549b 100644 --- a/Symfony/Tests/ControlStructure/IdenticalComparisonUnitTest.php +++ b/Symfony/Tests/ControlStructure/IdenticalComparisonUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\ControlStructure; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the IdenticalComparisonUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class IdenticalComparisonUnitTest extends AbstractSniffUnitTest +class IdenticalComparisonUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/ControlStructure/UnaryOperatorsUnitTest.php b/Symfony/Tests/ControlStructure/UnaryOperatorsUnitTest.php index d73f320..2d881ae 100644 --- a/Symfony/Tests/ControlStructure/UnaryOperatorsUnitTest.php +++ b/Symfony/Tests/ControlStructure/UnaryOperatorsUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\ControlStructure; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the UnaryOperatorsUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class UnaryOperatorsUnitTest extends AbstractSniffUnitTest +class UnaryOperatorsUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/ControlStructure/YodaConditionsUnitTest.php b/Symfony/Tests/ControlStructure/YodaConditionsUnitTest.php index f409e1b..2ab1476 100644 --- a/Symfony/Tests/ControlStructure/YodaConditionsUnitTest.php +++ b/Symfony/Tests/ControlStructure/YodaConditionsUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\ControlStructure; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the YodaConditionsUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class YodaConditionsUnitTest extends AbstractSniffUnitTest +class YodaConditionsUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Errors/ExceptionMessageUnitTest.php b/Symfony/Tests/Errors/ExceptionMessageUnitTest.php index 87bb6c7..4dffe61 100644 --- a/Symfony/Tests/Errors/ExceptionMessageUnitTest.php +++ b/Symfony/Tests/Errors/ExceptionMessageUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Errors; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the ExceptionMessageUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class ExceptionMessageUnitTest extends AbstractSniffUnitTest +class ExceptionMessageUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Errors/UserDeprecatedUnitTest.php b/Symfony/Tests/Errors/UserDeprecatedUnitTest.php index 10d9c17..941d0bd 100644 --- a/Symfony/Tests/Errors/UserDeprecatedUnitTest.php +++ b/Symfony/Tests/Errors/UserDeprecatedUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Errors; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the UserDeprecatedUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class UserDeprecatedUnitTest extends AbstractSniffUnitTest +class UserDeprecatedUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Files/AlphanumericFilenameUnitTest.php b/Symfony/Tests/Files/AlphanumericFilenameUnitTest.php index d2c94ab..8f4d861 100644 --- a/Symfony/Tests/Files/AlphanumericFilenameUnitTest.php +++ b/Symfony/Tests/Files/AlphanumericFilenameUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Files; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the AlphanumericFilenameUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class AlphanumericFilenameUnitTest extends AbstractSniffUnitTest +class AlphanumericFilenameUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Formatting/BlankLineBeforeReturnUnitTest.php b/Symfony/Tests/Formatting/BlankLineBeforeReturnUnitTest.php index efbaa5a..2513e42 100644 --- a/Symfony/Tests/Formatting/BlankLineBeforeReturnUnitTest.php +++ b/Symfony/Tests/Formatting/BlankLineBeforeReturnUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Formatting; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the BlankLineBeforeReturn sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class BlankLineBeforeReturnUnitTest extends AbstractSniffUnitTest +class BlankLineBeforeReturnUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Formatting/ReturnOrThrowUnitTest.php b/Symfony/Tests/Formatting/ReturnOrThrowUnitTest.php index bf0135e..6911bd2 100644 --- a/Symfony/Tests/Formatting/ReturnOrThrowUnitTest.php +++ b/Symfony/Tests/Formatting/ReturnOrThrowUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Formatting; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the ReturnOrThrowUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class ReturnOrThrowUnitTest extends AbstractSniffUnitTest +class ReturnOrThrowUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Functions/ArgumentsUnitTest.php b/Symfony/Tests/Functions/ArgumentsUnitTest.php index 6908e7a..ccef9ba 100644 --- a/Symfony/Tests/Functions/ArgumentsUnitTest.php +++ b/Symfony/Tests/Functions/ArgumentsUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Functions; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the ArgumentsUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class ArgumentsUnitTest extends AbstractSniffUnitTest +class ArgumentsUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Functions/ReturnTypeUnitTest.php b/Symfony/Tests/Functions/ReturnTypeUnitTest.php index 47cf26c..d9b827a 100644 --- a/Symfony/Tests/Functions/ReturnTypeUnitTest.php +++ b/Symfony/Tests/Functions/ReturnTypeUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Functions; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the ReturnTypeUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class ReturnTypeUnitTest extends AbstractSniffUnitTest +class ReturnTypeUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Functions/ScopeOrderUnitTest.php b/Symfony/Tests/Functions/ScopeOrderUnitTest.php index f8de028..a2cadaf 100644 --- a/Symfony/Tests/Functions/ScopeOrderUnitTest.php +++ b/Symfony/Tests/Functions/ScopeOrderUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Functions; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the ScopeOrderUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class ScopeOrderUnitTest extends AbstractSniffUnitTest +class ScopeOrderUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/NamingConventions/ValidClassNameUnitTest.php b/Symfony/Tests/NamingConventions/ValidClassNameUnitTest.php index fef39bf..356e84c 100644 --- a/Symfony/Tests/NamingConventions/ValidClassNameUnitTest.php +++ b/Symfony/Tests/NamingConventions/ValidClassNameUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\NamingConventions; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the ValidClassNameUnitTest sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class ValidClassNameUnitTest extends AbstractSniffUnitTest +class ValidClassNameUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Objects/ObjectInstantiationUnitTest.php b/Symfony/Tests/Objects/ObjectInstantiationUnitTest.php index 653bc38..550a559 100644 --- a/Symfony/Tests/Objects/ObjectInstantiationUnitTest.php +++ b/Symfony/Tests/Objects/ObjectInstantiationUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Objects; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the ObjectInstantiation sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class ObjectInstantiationUnitTest extends AbstractSniffUnitTest +class ObjectInstantiationUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Whitespace/AssignmentSpacingUnitTest.php b/Symfony/Tests/Whitespace/AssignmentSpacingUnitTest.php index bb00a32..e334f9c 100644 --- a/Symfony/Tests/Whitespace/AssignmentSpacingUnitTest.php +++ b/Symfony/Tests/Whitespace/AssignmentSpacingUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Whitespace; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the AssignmentSpacing sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class AssignmentSpacingUnitTest extends AbstractSniffUnitTest +class AssignmentSpacingUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Whitespace/BinaryOperatorSpacingUnitTest.php b/Symfony/Tests/Whitespace/BinaryOperatorSpacingUnitTest.php index 0db7c23..05dc920 100644 --- a/Symfony/Tests/Whitespace/BinaryOperatorSpacingUnitTest.php +++ b/Symfony/Tests/Whitespace/BinaryOperatorSpacingUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Whitespace; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the BinaryOperatorSpacing sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class BinaryOperatorSpacingUnitTest extends AbstractSniffUnitTest +class BinaryOperatorSpacingUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Whitespace/CommaSpacingUnitTest.php b/Symfony/Tests/Whitespace/CommaSpacingUnitTest.php index c2f693b..51fa14b 100644 --- a/Symfony/Tests/Whitespace/CommaSpacingUnitTest.php +++ b/Symfony/Tests/Whitespace/CommaSpacingUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Whitespace; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the CommaSpacing sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class CommaSpacingUnitTest extends AbstractSniffUnitTest +class CommaSpacingUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/Tests/Whitespace/DiscourageFitzinatorUnitTest.php b/Symfony/Tests/Whitespace/DiscourageFitzinatorUnitTest.php index ae73834..228eee7 100644 --- a/Symfony/Tests/Whitespace/DiscourageFitzinatorUnitTest.php +++ b/Symfony/Tests/Whitespace/DiscourageFitzinatorUnitTest.php @@ -14,7 +14,7 @@ namespace Symfony\Tests\Whitespace; -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase; /** * Unit test class for the DiscourageFitzinator sniff. @@ -30,7 +30,7 @@ * @license http://spdx.org/licenses/MIT MIT License * @link https://github.com/djoos/Symfony2-coding-standard */ -class DiscourageFitzinatorUnitTest extends AbstractSniffUnitTest +class DiscourageFitzinatorUnitTest extends AbstractSniffTestCase { /** * Returns the lines where errors should occur. diff --git a/Symfony/ruleset.xml b/Symfony/ruleset.xml index 073590d..b302f7a 100755 --- a/Symfony/ruleset.xml +++ b/Symfony/ruleset.xml @@ -44,9 +44,6 @@ - - - diff --git a/composer.json b/composer.json index 7a24769..a45c84e 100644 --- a/composer.json +++ b/composer.json @@ -25,12 +25,12 @@ "issues": "https://github.com/djoos/Symfony-coding-standard/issues" }, "require": { - "squizlabs/php_codesniffer": "^3.3.1" + "squizlabs/php_codesniffer": "^4.0.0" }, "require-dev": { - "phpunit/phpunit": "^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "phpunit/phpunit": "^8.0 || ^9.3.4 || ^10.5.32 || ^11.3.3" }, "conflict": { - "squizlabs/php_codesniffer": "<3 || >=4" + "squizlabs/php_codesniffer": "<4 || >=5" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f0c524b..f65559f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,7 +12,7 @@ > - ./vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php + ./Symfony/Tests diff --git a/tests_bootstrap.php b/tests_bootstrap.php index 54a1ecb..f452cdc 100644 --- a/tests_bootstrap.php +++ b/tests_bootstrap.php @@ -16,7 +16,7 @@ require_once __DIR__.'/vendor/squizlabs/php_codesniffer/tests/bootstrap.php'; // Add this Standard -PHP_CodeSniffer\Config::setConfigData( +(new PHP_CodeSniffer\Config)->setConfigData( 'installed_paths', __DIR__.DIRECTORY_SEPARATOR.'Symfony', true