diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
index a122d6a..1f2e7f5 100644
--- a/.github/workflows/php.yml
+++ b/.github/workflows/php.yml
@@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
- php-version: '7.4'
+ php-version: '8.0'
env:
update: true
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3e417a0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.idea/*
+vendor/*
diff --git a/InfinityloopCodingStandard/Sniffs/Classes/FinalClassVisibilitySniff.php b/InfinityloopCodingStandard/Sniffs/Classes/FinalClassVisibilitySniff.php
index 6b2f56b..5040f86 100644
--- a/InfinityloopCodingStandard/Sniffs/Classes/FinalClassVisibilitySniff.php
+++ b/InfinityloopCodingStandard/Sniffs/Classes/FinalClassVisibilitySniff.php
@@ -72,10 +72,7 @@ public function process(\PHP_CodeSniffer\Files\File $phpcsFile, $variablePointer
$phpcsFile->fixer->endChangeset();
}
- /**
- * @return int|bool|null
- */
- private function findVisibilityPointer(\PHP_CodeSniffer\Files\File $phpcsFile, $variablePointer)
+ private function findVisibilityPointer(\PHP_CodeSniffer\Files\File $phpcsFile, $variablePointer) : int|bool|null
{
$visibilityPointer = $phpcsFile->findPrevious([\T_PUBLIC, \T_PROTECTED, \T_PRIVATE], $variablePointer);
diff --git a/InfinityloopCodingStandard/Sniffs/ControlStructures/SwitchCommentSpacingSniff.php b/InfinityloopCodingStandard/Sniffs/ControlStructures/SwitchCommentSpacingSniff.php
index 3e88747..8f79cc9 100644
--- a/InfinityloopCodingStandard/Sniffs/ControlStructures/SwitchCommentSpacingSniff.php
+++ b/InfinityloopCodingStandard/Sniffs/ControlStructures/SwitchCommentSpacingSniff.php
@@ -127,13 +127,7 @@ public function process(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr) : voi
}
}
- /**
- * @param \PHP_CodeSniffer\Files\File $phpcsFile
- * @param int|bool|null $stackPtr
- * @param int|null $end
- * @return bool|int
- */
- private function findNextCase(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr, ?int $end = null)
+ private function findNextCase(\PHP_CodeSniffer\Files\File $phpcsFile, int|bool|null $stackPtr, ?int $end = null) : bool|int
{
$tokens = $phpcsFile->getTokens();
diff --git a/InfinityloopCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php b/InfinityloopCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php
index 1a7bcd7..056e64d 100644
--- a/InfinityloopCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php
+++ b/InfinityloopCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php
@@ -31,28 +31,28 @@ public function process(\PHP_CodeSniffer\Files\File $phpcsFile, $usePointer) : v
$tokens = $phpcsFile->getTokens();
$nextTokenPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1);
\assert(\is_int($nextTokenPointer));
-
+
if ($tokens[$nextTokenPointer]['code'] === \T_STRING
&& ($tokens[$nextTokenPointer]['content'] === 'function' || $tokens[$nextTokenPointer]['content'] === 'const')
) {
$nextTokenPointer = TokenHelper::findNextEffective($phpcsFile, $nextTokenPointer + 1);
\assert(\is_int($nextTokenPointer));
}
-
+
if ($tokens[$nextTokenPointer]['code'] === \T_NS_SEPARATOR) {
return;
}
-
+
$fix = $phpcsFile->addFixableError(
'Use statement must start with a backslash.',
$nextTokenPointer,
self::CODE_DOES_NOT_START_WITH_BACKSLASH,
);
-
+
if (!$fix) {
return;
}
-
+
$phpcsFile->fixer->beginChangeset();
$phpcsFile->fixer->addContentBefore($nextTokenPointer, '\\');
$phpcsFile->fixer->endChangeset();
diff --git a/InfinityloopCodingStandard/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/InfinityloopCodingStandard/Sniffs/WhiteSpace/MemberVarSpacingSniff.php
index 41f6507..8cfe4e9 100644
--- a/InfinityloopCodingStandard/Sniffs/WhiteSpace/MemberVarSpacingSniff.php
+++ b/InfinityloopCodingStandard/Sniffs/WhiteSpace/MemberVarSpacingSniff.php
@@ -14,6 +14,7 @@ class MemberVarSpacingSniff extends \PHP_CodeSniffer\Sniffs\AbstractVariableSnif
* @return int|void
*/
//@phpcs:ignore Squiz.Commenting.FunctionComment.ScalarTypeHintMissing
+ //@phpcs:ignore SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
protected function processMemberVar(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
diff --git a/InfinityloopCodingStandard/ruleset.xml b/InfinityloopCodingStandard/ruleset.xml
index 16fb5d3..0ee092a 100644
--- a/InfinityloopCodingStandard/ruleset.xml
+++ b/InfinityloopCodingStandard/ruleset.xml
@@ -8,10 +8,6 @@
- ./../../../../../../app
- ./../../../../../../bin
- ./../../../../../../tests
- ./../../../../../../www
*/tests/*/data/*
*/vendor/*
*/vendor-bin/*
@@ -255,7 +251,6 @@
-
@@ -423,17 +418,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -484,7 +468,7 @@
-
+
diff --git a/composer.json b/composer.json
index 09de44c..f5327f2 100644
--- a/composer.json
+++ b/composer.json
@@ -6,15 +6,15 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
- "php": ">=7.4",
- "squizlabs/php_codesniffer": "~3.5.3",
- "slevomat/coding-standard": "~6.3.8"
+ "php": "^8.0",
+ "squizlabs/php_codesniffer": "~3.6.0",
+ "slevomat/coding-standard": "~7.0.8"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.2"
},
"scripts": {
- "codestyle": "phpcs --standard=vendor-bin/phpcs/vendor/infinityloop-dev/coding-standard/InfinityloopCodingStandard/ruleset.xml --extensions=php InfinityloopCodingStandard"
+ "codestyle": "phpcs --standard=InfinityloopCodingStandard --extensions=php InfinityloopCodingStandard"
},
"autoload": {
"psr-4": {
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000..15249ff
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,309 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "863c5ce60d03502971ee2ea7d1f7e381",
+ "packages": [
+ {
+ "name": "dealerdirect/phpcodesniffer-composer-installer",
+ "version": "v0.7.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
+ "reference": "fe390591e0241955f22eb9ba327d137e501c771c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c",
+ "reference": "fe390591e0241955f22eb9ba327d137e501c771c",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0 || ^2.0",
+ "php": ">=5.3",
+ "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0"
+ },
+ "require-dev": {
+ "composer/composer": "*",
+ "phpcompatibility/php-compatibility": "^9.0",
+ "sensiolabs/security-checker": "^4.1.0"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
+ },
+ "autoload": {
+ "psr-4": {
+ "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Franck Nijhof",
+ "email": "franck.nijhof@dealerdirect.com",
+ "homepage": "http://www.frenck.nl",
+ "role": "Developer / IT Manager"
+ }
+ ],
+ "description": "PHP_CodeSniffer Standards Composer Installer Plugin",
+ "homepage": "http://www.dealerdirect.com",
+ "keywords": [
+ "PHPCodeSniffer",
+ "PHP_CodeSniffer",
+ "code quality",
+ "codesniffer",
+ "composer",
+ "installer",
+ "phpcs",
+ "plugin",
+ "qa",
+ "quality",
+ "standard",
+ "standards",
+ "style guide",
+ "stylecheck",
+ "tests"
+ ],
+ "support": {
+ "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
+ "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
+ },
+ "time": "2020-12-07T18:04:37+00:00"
+ },
+ {
+ "name": "phpstan/phpdoc-parser",
+ "version": "0.5.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpdoc-parser.git",
+ "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e352d065af1ae9b41c12d1dfd309e90f7b1f55c9",
+ "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "phing/phing": "^2.16.3",
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^0.12.60",
+ "phpstan/phpstan-strict-rules": "^0.12.5",
+ "phpunit/phpunit": "^7.5.20",
+ "symfony/process": "^5.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PHPStan\\PhpDocParser\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPDoc parser with support for nullable, intersection and generic types",
+ "support": {
+ "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.4"
+ },
+ "time": "2021-04-03T14:46:19+00:00"
+ },
+ {
+ "name": "slevomat/coding-standard",
+ "version": "7.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/slevomat/coding-standard.git",
+ "reference": "48141737f9e5ed701ef8bcea2027e701b50bd932"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/48141737f9e5ed701ef8bcea2027e701b50bd932",
+ "reference": "48141737f9e5ed701ef8bcea2027e701b50bd932",
+ "shasum": ""
+ },
+ "require": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
+ "php": "^7.1 || ^8.0",
+ "phpstan/phpdoc-parser": "0.5.1 - 0.5.4",
+ "squizlabs/php_codesniffer": "^3.6.0"
+ },
+ "require-dev": {
+ "phing/phing": "2.16.4",
+ "php-parallel-lint/php-parallel-lint": "1.3.0",
+ "phpstan/phpstan": "0.12.86",
+ "phpstan/phpstan-deprecation-rules": "0.12.6",
+ "phpstan/phpstan-phpunit": "0.12.18",
+ "phpstan/phpstan-strict-rules": "0.12.9",
+ "phpunit/phpunit": "7.5.20|8.5.5|9.5.4"
+ },
+ "type": "phpcodesniffer-standard",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "6.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "SlevomatCodingStandard\\": "SlevomatCodingStandard"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
+ "support": {
+ "issues": "https://github.com/slevomat/coding-standard/issues",
+ "source": "https://github.com/slevomat/coding-standard/tree/7.0.8"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/kukulich",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-05-10T08:51:20+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625",
+ "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ },
+ "bin": [
+ "bin/phpcs",
+ "bin/phpcbf"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "keywords": [
+ "phpcs",
+ "standards"
+ ],
+ "support": {
+ "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
+ "source": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
+ },
+ "time": "2021-04-09T00:54:41+00:00"
+ }
+ ],
+ "packages-dev": [
+ {
+ "name": "bamarni/composer-bin-plugin",
+ "version": "1.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/bamarni/composer-bin-plugin.git",
+ "reference": "9329fb0fbe29e0e1b2db8f4639a193e4f5406225"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/9329fb0fbe29e0e1b2db8f4639a193e4f5406225",
+ "reference": "9329fb0fbe29e0e1b2db8f4639a193e4f5406225",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0 || ^2.0",
+ "php": "^5.5.9 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "composer/composer": "^1.0 || ^2.0",
+ "symfony/console": "^2.5 || ^3.0 || ^4.0"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "Bamarni\\Composer\\Bin\\Plugin"
+ },
+ "autoload": {
+ "psr-4": {
+ "Bamarni\\Composer\\Bin\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "No conflicts for your bin dependencies",
+ "keywords": [
+ "composer",
+ "conflict",
+ "dependency",
+ "executable",
+ "isolation",
+ "tool"
+ ],
+ "support": {
+ "issues": "https://github.com/bamarni/composer-bin-plugin/issues",
+ "source": "https://github.com/bamarni/composer-bin-plugin/tree/master"
+ },
+ "time": "2020-05-03T08:27:20+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "dev",
+ "stability-flags": [],
+ "prefer-stable": true,
+ "prefer-lowest": false,
+ "platform": {
+ "php": "^8.0"
+ },
+ "platform-dev": [],
+ "plugin-api-version": "2.0.0"
+}