diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0999cb3..9e0b5bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: - 'master' env: - CONSISTENCE_PHP_VERSION: '7.3' + CONSISTENCE_PHP_VERSION: '8.0' jobs: composer-validate: @@ -45,9 +45,9 @@ jobs: fail-fast: false matrix: php-version: - - '7.2' - - '7.3' - - '7.4' + - '8.0' + - '8.1' + - '8.2' steps: - @@ -108,9 +108,9 @@ jobs: fail-fast: false matrix: php-version: - - '7.2' - - '7.3' - - '7.4' + - '8.0' + - '8.1' + - '8.2' composer-dependencies: - 'highest' - 'lowest' diff --git a/Consistence/Sniffs/Exceptions/ExceptionDeclarationSniff.php b/Consistence/Sniffs/Exceptions/ExceptionDeclarationSniff.php index befffd6..9e1079f 100644 --- a/Consistence/Sniffs/Exceptions/ExceptionDeclarationSniff.php +++ b/Consistence/Sniffs/Exceptions/ExceptionDeclarationSniff.php @@ -17,8 +17,7 @@ class ExceptionDeclarationSniff implements \PHP_CodeSniffer\Sniffs\Sniff public const CODE_NOT_CHAINABLE = 'NotChainable'; public const CODE_INCORRECT_EXCEPTION_DIRECTORY = 'IncorrectExceptionDirectory'; - /** @var string */ - public $exceptionsDirectoryName = 'exceptions'; + public string $exceptionsDirectoryName = 'exceptions'; /** * @return int[] diff --git a/Consistence/Sniffs/NamingConventions/ValidVariableNameSniff.php b/Consistence/Sniffs/NamingConventions/ValidVariableNameSniff.php index 6fd7863..b61ca8c 100644 --- a/Consistence/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ b/Consistence/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -13,7 +13,7 @@ class ValidVariableNameSniff extends \PHP_CodeSniffer\Sniffs\AbstractVariableSni public const CODE_CAMEL_CAPS = 'NotCamelCaps'; /** @var string[] */ - private static $phpReservedVariables = [ + private static array $phpReservedVariables = [ '_SERVER', '_GET', '_POST', diff --git a/composer.json b/composer.json index f2a6cfd..4f275a1 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ } ], "require": { - "php": "~7.2", - "squizlabs/php_codesniffer": "~3.5.5", + "php": "~8.0", + "squizlabs/php_codesniffer": "~3.7", "slevomat/coding-standard": "~6.0" }, "require-dev": { diff --git a/tests/Sniffs/Exceptions/ExceptionDeclarationSniffTest.php b/tests/Sniffs/Exceptions/ExceptionDeclarationSniffTest.php index fbfb2ce..be41f88 100644 --- a/tests/Sniffs/Exceptions/ExceptionDeclarationSniffTest.php +++ b/tests/Sniffs/Exceptions/ExceptionDeclarationSniffTest.php @@ -205,7 +205,7 @@ public function testExceptionIsPlacedInCorrectDirectory(): void public function testExceptionIsPlacedInCorrectDirectoryOnWindows(): void { // PHP_CodeSniffer detects the path with backslashes on Windows - $resultFile = $this->checkFile(__DIR__ . '\data\ValidNameException.php', [ + $resultFile = $this->checkFile(__DIR__ . '/data/ValidNameException.php', [ 'exceptionsDirectoryName' => 'data', ]);