diff --git a/composer.json b/composer.json index 3a15d321..878d0eec 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,8 @@ "license": "GPL-3.0-or-later", "require": { "php": ">=7.4", - "moodlehq/moodle-cs": "^v3.3.11", - "phpcompatibility/php-compatibility": "dev-develop#0a17f9ed" + "moodlehq/moodle-cs": "^v3.3.12", + "phpcompatibility/php-compatibility": "dev-develop#306cd263" }, "config": { "platform": { diff --git a/composer.lock b/composer.lock index 00ccf136..3568cfce 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1f240b14e4e06c4a29dfe747bfe9fbb1", + "content-hash": "04850f493c5607268a216c743489db99", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -86,23 +86,23 @@ }, { "name": "moodlehq/moodle-cs", - "version": "v3.3.11", + "version": "v3.3.12", "source": { "type": "git", "url": "https://github.com/moodlehq/moodle-cs.git", - "reference": "a415a541c7b9b56698db8bf0335ce767d02c05bb" + "reference": "9e3dcb07bfb3d0642f74e15253a5b44388782425" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/a415a541c7b9b56698db8bf0335ce767d02c05bb", - "reference": "a415a541c7b9b56698db8bf0335ce767d02c05bb", + "url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/9e3dcb07bfb3d0642f74e15253a5b44388782425", + "reference": "9e3dcb07bfb3d0642f74e15253a5b44388782425", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "phpcompatibility/php-compatibility": "dev-develop#0a17f9ed", - "phpcsstandards/phpcsextra": "^1.1.0", - "squizlabs/php_codesniffer": "^3.7.2" + "phpcompatibility/php-compatibility": "dev-develop#306cd263", + "phpcsstandards/phpcsextra": "^1.2.1", + "squizlabs/php_codesniffer": "^3.8.0" }, "replace": { "moodlehq/moodle-local_codechecker": "3.1.0" @@ -131,22 +131,25 @@ "email": "andrew@nicols.co.uk" }, { - "name": "Eloy Lafuente", - "email": "stronk7@moodle.com" + "name": "Eloy Lafuente (stronk7)" } ], "description": "Moodle Coding Sniffer rules", "keywords": [ + "codesniffer", + "coding", + "moodle", "phpcs", - "standards", - "wordpress" + "sniff", + "standard", + "style" ], "support": { "issues": "https://github.com/moodlehq/moodle-cs/issues", "source": "https://github.com/moodlehq/moodle-cs", "wiki": "https://github.com/moodlehq/moodle-cs/wiki" }, - "time": "2023-11-29T16:29:32+00:00" + "time": "2023-12-19T15:30:23+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -154,12 +157,12 @@ "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "0a17f9ed" + "reference": "306cd263" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/0a17f9ed", - "reference": "0a17f9ed", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/306cd263", + "reference": "306cd263", "shasum": "" }, "require": { @@ -219,35 +222,36 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibility/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2023-09-13T12:40:15+00:00" + "time": "2023-12-04T17:28:03+00:00" }, { "name": "phpcsstandards/phpcsextra", - "version": "1.1.2", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5" + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5", - "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.1" + "phpcsstandards/phpcsutils": "^1.0.9", + "squizlabs/php_codesniffer": "^3.8.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcsstandards/phpcsdevcs": "^1.1.6", "phpcsstandards/phpcsdevtools": "^1.2.1", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -282,35 +286,50 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, - "time": "2023-09-20T22:06:18+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T16:49:07+00:00" }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7" + "reference": "908247bc65010c7b7541a9551e002db12e9dae70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7", - "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", + "reference": "908247bc65010c7b7541a9551e002db12e9dae70", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.8.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcsstandards/phpcsdevcs": "^1.1.6", - "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -355,22 +374,37 @@ "support": { "docs": "https://phpcsutils.com/", "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", "source": "https://github.com/PHPCSStandards/PHPCSUtils" }, - "time": "2023-07-16T21:39:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T14:50:00+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.8.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", "shasum": "" }, "require": { @@ -380,7 +414,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/phpcs", @@ -399,22 +433,45 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "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", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T12:32:31+00:00" } ], "packages-dev": [], diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index a146dda9..aaaf7ff5 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,35 +3,35 @@ vendor/squizlabs/php_codesniffer PHP_CodeSniffer - 3.7.2 (ed8e00df0) + 3.8.0 BSD 3-Clause vendor/phpcompatibility/php-compatibility PHP Compatibility Coding Standard - 10.0dev (0a17f9ed) + 10.0dev (306cd263) LGPL 3 vendor/phpcsstandards/phpcsextra A collection of code standards for use with PHP_CodeSniffer - 1.1.2 (746c319) + 1.2.1 LGPL 3 vendor/phpcsstandards/phpcsutils A suite of utility functions for use with PHP_CodeSniffer - 1.0.8 (69465ca) + 1.0.9 LGPL 3 vendor/moodlehq/moodle-cs Moodle Coding Style - v3.3.8 (ff540d2) + v3.3.12 GPL 3 diff --git a/vendor/autoload.php b/vendor/autoload.php index 0f8907d9..008f6210 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit64503f750e78560d45fa4b45a3035e4a::getLoader(); +return ComposerAutoloaderInit04850f493c5607268a216c743489db99::getLoader(); diff --git a/vendor/bin/phpcbf b/vendor/bin/phpcbf index 2d75fbbf..1c0c79c4 100755 --- a/vendor/bin/phpcbf +++ b/vendor/bin/phpcbf @@ -116,9 +116,4 @@ if (PHP_VERSION_ID < 80000) { } } - -if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) { - $_SERVER['SCRIPT_NAME'] = realpath(__DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'); -} - return include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'; diff --git a/vendor/bin/phpcs b/vendor/bin/phpcs index 377580a7..04e658cf 100755 --- a/vendor/bin/phpcs +++ b/vendor/bin/phpcs @@ -116,9 +116,4 @@ if (PHP_VERSION_ID < 80000) { } } - -if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) { - $_SERVER['SCRIPT_NAME'] = realpath(__DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'); -} - return include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'; diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index b6367cf3..6d8cd7b4 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit64503f750e78560d45fa4b45a3035e4a +class ComposerAutoloaderInit04850f493c5607268a216c743489db99 { private static $loader; @@ -24,12 +24,12 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit64503f750e78560d45fa4b45a3035e4a', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit04850f493c5607268a216c743489db99', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit64503f750e78560d45fa4b45a3035e4a', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit04850f493c5607268a216c743489db99', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit64503f750e78560d45fa4b45a3035e4a::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit04850f493c5607268a216c743489db99::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 234d5bdf..bced0c6d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit64503f750e78560d45fa4b45a3035e4a +class ComposerStaticInit04850f493c5607268a216c743489db99 { public static $prefixLengthsPsr4 = array ( 'P' => @@ -72,9 +72,9 @@ class ComposerStaticInit64503f750e78560d45fa4b45a3035e4a public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit64503f750e78560d45fa4b45a3035e4a::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit64503f750e78560d45fa4b45a3035e4a::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit64503f750e78560d45fa4b45a3035e4a::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit04850f493c5607268a216c743489db99::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit04850f493c5607268a216c743489db99::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit04850f493c5607268a216c743489db99::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 977e8922..201ef4f8 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -83,24 +83,24 @@ }, { "name": "moodlehq/moodle-cs", - "version": "v3.3.11", - "version_normalized": "3.3.11.0", + "version": "v3.3.12", + "version_normalized": "3.3.12.0", "source": { "type": "git", "url": "https://github.com/moodlehq/moodle-cs.git", - "reference": "a415a541c7b9b56698db8bf0335ce767d02c05bb" + "reference": "9e3dcb07bfb3d0642f74e15253a5b44388782425" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/a415a541c7b9b56698db8bf0335ce767d02c05bb", - "reference": "a415a541c7b9b56698db8bf0335ce767d02c05bb", + "url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/9e3dcb07bfb3d0642f74e15253a5b44388782425", + "reference": "9e3dcb07bfb3d0642f74e15253a5b44388782425", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "phpcompatibility/php-compatibility": "dev-develop#0a17f9ed", - "phpcsstandards/phpcsextra": "^1.1.0", - "squizlabs/php_codesniffer": "^3.7.2" + "phpcompatibility/php-compatibility": "dev-develop#306cd263", + "phpcsstandards/phpcsextra": "^1.2.1", + "squizlabs/php_codesniffer": "^3.8.0" }, "replace": { "moodlehq/moodle-local_codechecker": "3.1.0" @@ -113,7 +113,7 @@ "sebastian/phpcpd": "^6.0", "thor-juhasz/phpunit-coverage-check": "^0.3.0" }, - "time": "2023-11-29T16:29:32+00:00", + "time": "2023-12-19T15:30:23+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "autoload": { @@ -131,15 +131,18 @@ "email": "andrew@nicols.co.uk" }, { - "name": "Eloy Lafuente", - "email": "stronk7@moodle.com" + "name": "Eloy Lafuente (stronk7)" } ], "description": "Moodle Coding Sniffer rules", "keywords": [ + "codesniffer", + "coding", + "moodle", "phpcs", - "standards", - "wordpress" + "sniff", + "standard", + "style" ], "support": { "issues": "https://github.com/moodlehq/moodle-cs/issues", @@ -155,12 +158,12 @@ "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "0a17f9ed" + "reference": "306cd263" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/0a17f9ed", - "reference": "0a17f9ed", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/306cd263", + "reference": "306cd263", "shasum": "" }, "require": { @@ -182,7 +185,7 @@ "suggest": { "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, - "time": "2023-09-13T12:40:15+00:00", + "time": "2023-12-04T17:28:03+00:00", "default-branch": true, "type": "phpcodesniffer-standard", "extra": { @@ -222,38 +225,39 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibility/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, "install-path": "../phpcompatibility/php-compatibility" }, { "name": "phpcsstandards/phpcsextra", - "version": "1.1.2", - "version_normalized": "1.1.2.0", + "version": "1.2.1", + "version_normalized": "1.2.1.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5" + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5", - "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.1" + "phpcsstandards/phpcsutils": "^1.0.9", + "squizlabs/php_codesniffer": "^3.8.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcsstandards/phpcsdevcs": "^1.1.6", "phpcsstandards/phpcsdevtools": "^1.2.1", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, - "time": "2023-09-20T22:06:18+00:00", + "time": "2023-12-08T16:49:07+00:00", "type": "phpcodesniffer-standard", "extra": { "branch-alias": { @@ -288,38 +292,53 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], "install-path": "../phpcsstandards/phpcsextra" }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.8", - "version_normalized": "1.0.8.0", + "version": "1.0.9", + "version_normalized": "1.0.9.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7" + "reference": "908247bc65010c7b7541a9551e002db12e9dae70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7", - "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", + "reference": "908247bc65010c7b7541a9551e002db12e9dae70", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.8.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcsstandards/phpcsdevcs": "^1.1.6", - "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" }, - "time": "2023-07-16T21:39:41+00:00", + "time": "2023-12-08T14:50:00+00:00", "type": "phpcodesniffer-standard", "extra": { "branch-alias": { @@ -364,23 +383,38 @@ "support": { "docs": "https://phpcsutils.com/", "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", "source": "https://github.com/PHPCSStandards/PHPCSUtils" }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], "install-path": "../phpcsstandards/phpcsutils" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", - "version_normalized": "3.7.2.0", + "version": "3.8.0", + "version_normalized": "3.8.0.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", "shasum": "" }, "require": { @@ -390,9 +424,9 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, - "time": "2023-02-22T23:07:41+00:00", + "time": "2023-12-08T12:32:31+00:00", "bin": [ "bin/phpcs", "bin/phpcbf" @@ -411,21 +445,44 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "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", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], "install-path": "../squizlabs/php_codesniffer" } ], diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 918156a0..a9ca4dab 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'moodlehq/local_codechecker', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '0eecbc52b33aea33f319d87830ea4281d80e70ea', + 'reference' => '30b722a87b99d45f6d35ecbc1c3f7c36badf848e', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -22,16 +22,16 @@ 'moodlehq/local_codechecker' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '0eecbc52b33aea33f319d87830ea4281d80e70ea', + 'reference' => '30b722a87b99d45f6d35ecbc1c3f7c36badf848e', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'moodlehq/moodle-cs' => array( - 'pretty_version' => 'v3.3.11', - 'version' => '3.3.11.0', - 'reference' => 'a415a541c7b9b56698db8bf0335ce767d02c05bb', + 'pretty_version' => 'v3.3.12', + 'version' => '3.3.12.0', + 'reference' => '9e3dcb07bfb3d0642f74e15253a5b44388782425', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../moodlehq/moodle-cs', 'aliases' => array(), @@ -46,7 +46,7 @@ 'phpcompatibility/php-compatibility' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '0a17f9ed', + 'reference' => '306cd263', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility', 'aliases' => array( @@ -55,27 +55,27 @@ 'dev_requirement' => false, ), 'phpcsstandards/phpcsextra' => array( - 'pretty_version' => '1.1.2', - 'version' => '1.1.2.0', - 'reference' => '746c3190ba8eb2f212087c947ba75f4f5b9a58d5', + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'reference' => '11d387c6642b6e4acaf0bd9bf5203b8cca1ec489', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../phpcsstandards/phpcsextra', 'aliases' => array(), 'dev_requirement' => false, ), 'phpcsstandards/phpcsutils' => array( - 'pretty_version' => '1.0.8', - 'version' => '1.0.8.0', - 'reference' => '69465cab9d12454e5e7767b9041af0cd8cd13be7', + 'pretty_version' => '1.0.9', + 'version' => '1.0.9.0', + 'reference' => '908247bc65010c7b7541a9551e002db12e9dae70', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../phpcsstandards/phpcsutils', 'aliases' => array(), 'dev_requirement' => false, ), 'squizlabs/php_codesniffer' => array( - 'pretty_version' => '3.7.2', - 'version' => '3.7.2.0', - 'reference' => 'ed8e00df0a83aa96acf703f8c2979ff33341f879', + 'pretty_version' => '3.8.0', + 'version' => '3.8.0.0', + 'reference' => '5805f7a4e4958dbb5e944ef1e6edae0a303765e7', 'type' => 'library', 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', 'aliases' => array(), diff --git a/vendor/moodlehq/moodle-cs/composer.json b/vendor/moodlehq/moodle-cs/composer.json index 3ec2e096..2d999892 100644 --- a/vendor/moodlehq/moodle-cs/composer.json +++ b/vendor/moodlehq/moodle-cs/composer.json @@ -3,9 +3,13 @@ "type": "phpcodesniffer-standard", "description": "Moodle Coding Sniffer rules", "keywords": [ + "moodle", "phpcs", - "standards", - "WordPress" + "coding", + "style", + "standard", + "sniff", + "codesniffer" ], "license": "GPL-2.0-or-later", "authors": [ @@ -14,15 +18,14 @@ "email": "andrew@nicols.co.uk" }, { - "name": "Eloy Lafuente", - "email": "stronk7@moodle.com" + "name": "Eloy Lafuente (stronk7)" } ], "require": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "squizlabs/php_codesniffer": "^3.7.2", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcompatibility/php-compatibility": "dev-develop#0a17f9ed" + "squizlabs/php_codesniffer": "^3.8.0", + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcompatibility/php-compatibility": "dev-develop#306cd263" }, "config": { "allow-plugins": { diff --git a/vendor/moodlehq/moodle-cs/moodle/Sniffs/Arrays/CommaAfterLastSniff.php b/vendor/moodlehq/moodle-cs/moodle/Sniffs/Arrays/CommaAfterLastSniff.php deleted file mode 100644 index 0345cc35..00000000 --- a/vendor/moodlehq/moodle-cs/moodle/Sniffs/Arrays/CommaAfterLastSniff.php +++ /dev/null @@ -1,226 +0,0 @@ - - */ - private $validValues = [ - 'enforce' => true, - 'forbid' => true, - 'skip' => true, - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return Collections::arrayOpenTokensBC(); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // Validate the property input. Invalid values will result in the check being skipped. - if (isset($this->validValues[$this->singleLine]) === false) { - $this->singleLine = 'skip'; - } - if (isset($this->validValues[$this->multiLine]) === false) { - $this->multiLine = 'skip'; - } - - $openClose = Arrays::getOpenClose($phpcsFile, $stackPtr); - if ($openClose === false) { - // Short list, real square bracket, live coding or parse error. - return; - } - - $tokens = $phpcsFile->getTokens(); - $opener = $openClose['opener']; - $closer = $openClose['closer']; - - $action = $this->singleLine; - $phrase = 'single-line'; - $errorCode = 'SingleLine'; - if ($tokens[$opener]['line'] !== $tokens[$closer]['line']) { - $action = $this->multiLine; - $phrase = 'multi-line'; - $errorCode = 'MultiLine'; - } - - if ($action === 'skip') { - // Nothing to do. - return; - } - - $lastNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closer - 1), $opener, true); - if ($lastNonEmpty === false || $lastNonEmpty === $opener) { - // Bow out: empty array. - return; - } - - // If the closer is on the same line as the last element, change the error code for multi-line arrays. - if ($errorCode === 'MultiLine' - && $tokens[$lastNonEmpty]['line'] === $tokens[$closer]['line'] - ) { - $errorCode .= 'CloserSameLine'; - } - - $isComma = ($tokens[$lastNonEmpty]['code'] === \T_COMMA); - - $phpcsFile->recordMetric( - $stackPtr, - \sprintf(self::METRIC_NAME, \ucfirst($phrase)), - ($isComma === true ? 'yes' : 'no') - ); - - switch ($action) { - case 'enforce': - if ($isComma === true) { - return; - } - - $error = 'There should be a comma after the last array item in a %s array.'; - $errorCode = 'Missing' . $errorCode; - $data = [$phrase]; - $fix = $phpcsFile->addFixableError($error, $lastNonEmpty, $errorCode, $data); - if ($fix === true) { - $extraContent = ','; - - if (($tokens[$lastNonEmpty]['code'] === \T_END_HEREDOC - || $tokens[$lastNonEmpty]['code'] === \T_END_NOWDOC) - // Check for indentation, if indented, it's a PHP 7.3+ heredoc/nowdoc. - && $tokens[$lastNonEmpty]['content'] === \ltrim($tokens[$lastNonEmpty]['content']) - ) { - // Prevent parse errors in PHP < 7.3 which doesn't support flexible heredoc/nowdoc. - $extraContent = $phpcsFile->eolChar . $extraContent; - } - - $phpcsFile->fixer->addContent($lastNonEmpty, $extraContent); - } - - return; - - case 'forbid': - if ($isComma === false) { - return; - } - - $error = 'A comma after the last array item in a %s array is not allowed.'; - $errorCode = 'Found' . $errorCode; - $data = [$phrase]; - $fix = $phpcsFile->addFixableError($error, $lastNonEmpty, $errorCode, $data); - if ($fix === true) { - $start = $lastNonEmpty; - $end = $lastNonEmpty; - - // Make sure we're not leaving a superfluous blank line behind. - $prevNonWhitespace = $phpcsFile->findPrevious(\T_WHITESPACE, ($lastNonEmpty - 1), $opener, true); - $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($lastNonEmpty + 1), ($closer + 1), true); - if ($prevNonWhitespace !== false - && $tokens[$prevNonWhitespace]['line'] < $tokens[$lastNonEmpty]['line'] - && $nextNonWhitespace !== false - && $tokens[$nextNonWhitespace]['line'] > $tokens[$lastNonEmpty]['line'] - ) { - $start = ($prevNonWhitespace + 1); - } - - $phpcsFile->fixer->beginChangeset(); - - for ($i = $start; $i <= $end; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - } - } -} diff --git a/vendor/moodlehq/moodle-cs/moodle/ruleset.xml b/vendor/moodlehq/moodle-cs/moodle/ruleset.xml index 74ec915b..8098255c 100644 --- a/vendor/moodlehq/moodle-cs/moodle/ruleset.xml +++ b/vendor/moodlehq/moodle-cs/moodle/ruleset.xml @@ -20,15 +20,10 @@ Affects all major branches since Moodle 3.9. Require a comma after the last element in a multi-line array, but prevent in a single-line array definition - - TODO: Enable this back and remove our copied Sniff below once PHPCSExtra v1.2.0 is released. + --> - --> - - - @@ -107,21 +102,6 @@ - - - - - - 0 @@ -131,7 +111,6 @@ Namespace statements, and class imports (use statements) should not use a leading backslash. --> - diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php index 73a3cbb8..83321c2d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php @@ -44,10 +44,10 @@ abstract class AbstractFunctionCallParameterSniff extends Sniff * * @since 8.2.0 * - * @var array The only requirement for this array is that the top level - * array keys are the names of the functions you're looking for. - * Other than that, the array can have arbitrary content - * depending on your needs. + * @var array The only requirement for this array is that the top level + * array keys are the names of the functions you're looking for. + * Other than that, the array can have arbitrary content + * depending on your needs. */ protected $targetFunctions = []; @@ -59,7 +59,7 @@ abstract class AbstractFunctionCallParameterSniff extends Sniff * * @since 8.2.0 * - * @var array + * @var array */ private $ignoreTokens = [ \T_NEW => true, @@ -71,7 +71,7 @@ abstract class AbstractFunctionCallParameterSniff extends Sniff * * @since 8.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractInitialValueSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractInitialValueSniff.php index afdf1e95..96e761c7 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractInitialValueSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractInitialValueSniff.php @@ -40,7 +40,7 @@ abstract class AbstractInitialValueSniff extends Sniff * * @since 10.0.0 * - * @var array Type indicator => suggested partial error phrase + * @var array Type indicator => suggested partial error phrase. */ protected $initialValueTypes = [ 'const' => 'when defining constants using the const keyword', @@ -54,7 +54,7 @@ abstract class AbstractInitialValueSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionDeprecatedRemovedFeatureTrait.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionDeprecatedRemovedFeatureTrait.php index 8123869a..537b1edd 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionDeprecatedRemovedFeatureTrait.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionDeprecatedRemovedFeatureTrait.php @@ -98,7 +98,7 @@ protected function getVersionInfo(array $itemArray) * @param string $itemBaseCode The basis for the error code. * @param string[] $versionInfo Array of version info as received from the getVersionInfo() method. * - * @return array + * @return array */ protected function getMessageInfo($itemName, $itemBaseCode, array $versionInfo) { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionNewFeatureTrait.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionNewFeatureTrait.php index 6b6601ad..42279e4c 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionNewFeatureTrait.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ComplexVersionNewFeatureTrait.php @@ -77,7 +77,7 @@ protected function getVersionInfo(array $itemArray) * @param string $itemBaseCode The basis for the error code. * @param string[] $versionInfo Array of version info as received from the getVersionInfo() method. * - * @return array + * @return array */ protected function getMessageInfo($itemName, $itemBaseCode, array $versionInfo) { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/HashAlgorithmsTrait.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/HashAlgorithmsTrait.php index a6bd4c9a..c058de1b 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/HashAlgorithmsTrait.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/HashAlgorithmsTrait.php @@ -41,7 +41,7 @@ trait HashAlgorithmsTrait * @since 7.0.7 Moved from the `RemovedHashAlgorithms` sniff to the base `Sniff` class. * @since 10.0.0 Moved from the base `Sniff` class to the `HashAlgorithmsTrait`. * - * @var array + * @var array> */ protected $hashAlgoFunctions = [ 'hash_file' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/PCRERegexTrait.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/PCRERegexTrait.php index 568082eb..5a6b503d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/PCRERegexTrait.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/PCRERegexTrait.php @@ -40,7 +40,7 @@ trait PCRERegexTrait * @since 7.0.5 This array was originally contained within the `process()` method. * @since 10.0.0 Moved from the `RemovedPCREModifiersSniff` to this trait. * - * @var array + * @var array */ private $doublesSeparators = [ '{' => '}', diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ScannedCode.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ScannedCode.php index 593817de..160c2a63 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ScannedCode.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Helpers/ScannedCode.php @@ -38,16 +38,16 @@ final class ScannedCode * Default testVersion if no valid testVersion was provided or * could be determined based on the provided information. * - * @var array + * @var array */ private static $testVersionsDefault = [null, null]; /** * Test versions applicable for the current PHPCS run. * - * @var array Array with two values. - * Index 0 contains the low end supported PHP version. - * Index 1 contains the high end supported PHP version. + * @var array Array with two values. + * Index 0 contains the low end supported PHP version. + * Index 1 contains the high end supported PHP version. */ private static $testVersions; @@ -82,9 +82,9 @@ final class ScannedCode * - Will throw a PHP Exception instead of a warning for an invalid testVersion. * - The method is now static. * - * @return array An array containing min/max version of PHP that we are checking - * against (see above). If only a single version number is specified, - * then this is used as both the min and max. + * @return array An array containing min/max version of PHP that we are checking + * against (see above). If only a single version number is specified, + * then this is used as both the min and max. * * @throws \PHPCompatibility\Exceptions\InvalidTestVersionRange When the range in the testVersion is invalid. * @throws \PHPCompatibility\Exceptions\InvalidTestVersion When the testVersion itself is invalid. diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Attributes/NewAttributesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Attributes/NewAttributesSniff.php index 62f1ba5b..80511aa5 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Attributes/NewAttributesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Attributes/NewAttributesSniff.php @@ -41,7 +41,7 @@ class NewAttributesSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenExtendingFinalPHPClassSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenExtendingFinalPHPClassSniff.php index 6042f4c8..de55cd9e 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenExtendingFinalPHPClassSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenExtendingFinalPHPClassSniff.php @@ -30,8 +30,8 @@ class ForbiddenExtendingFinalPHPClassSniff extends Sniff * * @since 10.0.0 * - * @var array(string => int) Key is the fully qualified classname. - * Value the PHP version in which the class became final. + * @var array Key is the fully qualified classname. + * Value the PHP version in which the class became final. */ protected $finalClasses = [ '\__PHP_Incomplete_Class' => '8.0', @@ -42,7 +42,7 @@ class ForbiddenExtendingFinalPHPClassSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php index fccb88ce..9415b571 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php @@ -32,7 +32,7 @@ class NewAnonymousClassesSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php index 3748ed4e..549f20a8 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php @@ -53,7 +53,7 @@ class NewClassesSniff extends Sniff * * @since 5.5 * - * @var array(string => array(string => bool)) + * @var array> */ protected $newClasses = [ 'ArrayObject' => [ @@ -871,7 +871,7 @@ class NewClassesSniff extends Sniff * * @since 7.1.4 * - * @var array(string => array(string => bool)) + * @var array> */ protected $newExceptions = [ 'com_exception' => [ @@ -1111,7 +1111,7 @@ class NewClassesSniff extends Sniff * as return type declarations. * @since 10.0.0 `T_RETURN_TYPE` token removed after PHPCS < 3.7.1 version drop. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php index 1317a1f8..6e9eeb03 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php @@ -34,7 +34,7 @@ class NewConstVisibilitySniff extends Sniff * * @since 7.0.7 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstructorPropertyPromotionSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstructorPropertyPromotionSniff.php index 84925a63..56030821 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstructorPropertyPromotionSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstructorPropertyPromotionSniff.php @@ -34,7 +34,7 @@ final class NewConstructorPropertyPromotionSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewFinalConstantsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewFinalConstantsSniff.php index b6dba642..918a2c26 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewFinalConstantsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewFinalConstantsSniff.php @@ -34,7 +34,7 @@ class NewFinalConstantsSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php index 9ee5f014..e357ad78 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php @@ -40,7 +40,7 @@ class NewLateStaticBindingSniff extends Sniff * @since 7.0.3 * @since 10.0.0 Now also sniffs for `T_STRING`. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyClassesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyClassesSniff.php index 4bd3fa31..c83488b5 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyClassesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyClassesSniff.php @@ -34,7 +34,7 @@ final class NewReadonlyClassesSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyPropertiesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyPropertiesSniff.php index f1bb810b..ce8eefdd 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyPropertiesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewReadonlyPropertiesSniff.php @@ -36,7 +36,7 @@ final class NewReadonlyPropertiesSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php index 1344cc2b..b9fcbef5 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php @@ -62,7 +62,7 @@ class NewTypedPropertiesSniff extends Sniff * * @since 10.0.0 * - * @var array(string => array(string => bool)) + * @var array> */ protected $newTypes = [ 'mixed' => [ @@ -93,7 +93,7 @@ class NewTypedPropertiesSniff extends Sniff * * @since 10.0.0 * - * @var array(string => string|false) + * @var array */ protected $invalidTypes = [ 'boolean' => 'bool', @@ -108,7 +108,7 @@ class NewTypedPropertiesSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var array */ protected $unionOnlyTypes = [ 'false' => true, @@ -121,7 +121,7 @@ class NewTypedPropertiesSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedClassesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedClassesSniff.php index a55897a4..c9f9ddc5 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedClassesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedClassesSniff.php @@ -55,7 +55,7 @@ class RemovedClassesSniff extends Sniff * * @since 10.0.0 * - * @var array(string => array(string => bool)) + * @var array> */ protected $removedClasses = [ 'HW_API' => [ @@ -204,7 +204,7 @@ class RemovedClassesSniff extends Sniff * * @since 10.0.0 * - * @var array(string => array(string => bool)) + * @var array> */ protected $removedExceptions = [ 'SQLiteException' => [ @@ -219,7 +219,7 @@ class RemovedClassesSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php index c15f9f52..6dd77258 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php @@ -38,7 +38,7 @@ class RemovedOrphanedParentSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsInTraitsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsInTraitsSniff.php index 104f2f0f..02f3faad 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsInTraitsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsInTraitsSniff.php @@ -34,7 +34,7 @@ final class NewConstantsInTraitsSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php index 73009412..8c005a9a 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php @@ -38,7 +38,7 @@ class NewConstantsSniff extends Sniff * * @since 8.1.0 * - * @var array(string => array(string => bool)) + * @var array> */ protected $newConstants = [ 'E_STRICT' => [ @@ -7705,6 +7705,342 @@ class NewConstantsSniff extends Sniff '8.2' => true, 'extension' => 'sockets', ], + + 'CURLINFO_CAPATH' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLINFO_CAINFO' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLOPT_MIME_OPTIONS' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLMIMEOPT_FORMESCAPE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLOPT_WS_OPTIONS' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLWS_RAW_MODE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLOPT_SSH_HOSTKEYFUNCTION' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLOPT_PROTOCOLS_STR' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLOPT_REDIR_PROTOCOLS_STR' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLOPT_CA_CACHE_TIMEOUT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLOPT_QUICK_EXIT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLKHMATCH_OK' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLKHMATCH_MISMATCH' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLKHMATCH_MISSING' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'CURLKHMATCH_LAST' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'curl', + ], + 'MIXED_NUMBERS' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'intl', + ], + 'HIDDEN_OVERLAY' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'intl', + ], + 'OPENSSL_CMS_OLDMIMETYPE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'openssl', + ], + 'PKCS7_NOOLDMIMETYPE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'openssl', + ], + 'SIGINFO' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pcntl', + ], + 'PDO_ODBC_TYPE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pdo_odbc', + ], + 'PGSQL_TRACE_SUPPRESS_TIMESTAMPS' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_TRACE_REGRESS_MODE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_ERRORS_SQLSTATE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_PIPELINE_SYNC' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_PIPELINE_ON' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_PIPELINE_OFF' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_PIPELINE_ABORTED' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_SHOW_CONTEXT_NEVER' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_SHOW_CONTEXT_ERRORS' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'PGSQL_SHOW_CONTEXT_ALWAYS' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'POSIX_SC_ARG_MAX' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_SC_PAGESIZE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_SC_NPROCESSORS_CONF' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_SC_NPROCESSORS_ONLN' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_LINK_MAX' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_MAX_CANON' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_MAX_INPUT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_NAME_MAX' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_PATH_MAX' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_PIPE_BUF' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_CHOWN_RESTRICTED' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_NO_TRUNC' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_ALLOC_SIZE_MIN' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'POSIX_PC_SYMLINK_MAX' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'SO_ATTACH_REUSEPORT_CBPF' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'SO_DETACH_FILTER' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'SO_DETACH_BPF' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'TCP_QUICKACK' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_DONTFRAG' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_MTU_DISCOVER' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_PMTUDISC_DO' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_PMTUDISC_DONT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_PMTUDISC_WANT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_PMTUDISC_PROBE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_PMTUDISC_INTERFACE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_PMTUDISC_OMIT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'AF_DIVERT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'SOL_UDPLITE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'UDPLITE_RECV_CSCOV' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'UDPLITE_SEND_CSCOV' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'SO_RERROR' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'SO_ZEROIZE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'SO_SPLICE' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'TCP_REPAIR' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'SO_REUSEPORT_LB' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], + 'IP_BIND_ADDRESS_NO_PORT' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], ]; @@ -7713,7 +8049,7 @@ class NewConstantsSniff extends Sniff * * @since 8.1.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php index 26ca3024..20397dec 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php @@ -43,7 +43,7 @@ class NewMagicClassConstantSniff extends Sniff * * @since 7.1.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php index f0434e20..13659b05 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php @@ -42,7 +42,7 @@ class RemovedConstantsSniff extends Sniff * * @since 8.1.0 * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $removedConstants = [ 'F_DUPFD' => [ @@ -2660,7 +2660,7 @@ class RemovedConstantsSniff extends Sniff * * @since 8.1.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php index ac9a6492..b3ede2e7 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php @@ -42,7 +42,7 @@ class DiscouragedSwitchContinueSniff extends Sniff * * @since 8.2.0 * - * @var array + * @var array */ protected $loopStructures = [ \T_FOR => \T_FOR, @@ -57,7 +57,7 @@ class DiscouragedSwitchContinueSniff extends Sniff * * @since 8.2.0 * - * @var array + * @var array */ protected $caseTokens = [ \T_CASE => \T_CASE, @@ -71,7 +71,7 @@ class DiscouragedSwitchContinueSniff extends Sniff * * @since 8.2.0 * - * @var array + * @var array */ protected $acceptedLevelTokens = [ \T_LNUMBER => \T_LNUMBER, @@ -85,7 +85,7 @@ class DiscouragedSwitchContinueSniff extends Sniff * * @since 8.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php index 5c580ebb..30fbaa28 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php @@ -35,7 +35,7 @@ class ForbiddenBreakContinueOutsideLoopSniff extends Sniff * * @since 7.0.7 * - * @var array + * @var array */ protected $validLoopStructures = [ \T_FOR => \T_FOR, @@ -50,7 +50,7 @@ class ForbiddenBreakContinueOutsideLoopSniff extends Sniff * * @since 7.0.7 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php index 089da91b..cd588f56 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php @@ -43,7 +43,7 @@ class ForbiddenBreakContinueVariableArgumentsSniff extends Sniff * @since 7.0.5 * @since 7.1.0 Changed from class constants to property. * - * @var array + * @var array */ private $errorTypes = [ 'variableArgument' => 'a variable argument', @@ -55,7 +55,7 @@ class ForbiddenBreakContinueVariableArgumentsSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var array */ private $varArgTokens = [ \T_VARIABLE => \T_VARIABLE, @@ -68,7 +68,7 @@ class ForbiddenBreakContinueVariableArgumentsSniff extends Sniff * * @since 5.5 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php index 0579705a..b7cc427c 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php @@ -32,7 +32,7 @@ class ForbiddenSwitchWithMultipleDefaultBlocksSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php index fba1d80b..f48a6254 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php @@ -52,7 +52,7 @@ class NewExecutionDirectivesSniff extends Sniff * * @since 7.0.3 * - * @var array(string => array(string => bool|string|array)) + * @var array> */ protected $newDirectives = [ 'ticks' => [ @@ -88,7 +88,7 @@ class NewExecutionDirectivesSniff extends Sniff * * @since 7.0.3 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php index b5b747e7..dc064a82 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php @@ -35,7 +35,7 @@ class NewForeachExpressionReferencingSniff extends Sniff * * @since 9.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php index ab210f3d..530f9b9f 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php @@ -33,7 +33,7 @@ class NewListInForeachSniff extends Sniff * * @since 9.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php index 1dc53409..cd11f8ab 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php @@ -33,7 +33,7 @@ class NewMultiCatchSniff extends Sniff * * @since 7.0.7 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewNonCapturingCatchSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewNonCapturingCatchSniff.php index fe040a92..48811ba6 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewNonCapturingCatchSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewNonCapturingCatchSniff.php @@ -33,7 +33,7 @@ class NewNonCapturingCatchSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php index 1f2a575a..3349a8c0 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php @@ -58,7 +58,7 @@ class RemovedExtensionsSniff extends Sniff * * @since 7.0.2 * - * @var array + * @var string[] */ public $functionWhitelist; @@ -70,7 +70,7 @@ class RemovedExtensionsSniff extends Sniff * * @since 5.5 * - * @var array(string => array(string => bool|string|null)) + * @var array> */ protected $removedExtensions = [ 'activescript' => [ @@ -212,7 +212,7 @@ class RemovedExtensionsSniff extends Sniff * * @since 5.5 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/AbstractPrivateMethodsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/AbstractPrivateMethodsSniff.php index 086daa90..3b72dbb1 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/AbstractPrivateMethodsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/AbstractPrivateMethodsSniff.php @@ -45,7 +45,7 @@ class AbstractPrivateMethodsSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php index 04345540..d58ece27 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php @@ -42,7 +42,7 @@ class ForbiddenFinalPrivateMethodsSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php index 27a7c6f1..8762eaff 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php @@ -37,7 +37,7 @@ class ForbiddenParameterShadowSuperGlobalsSniff extends Sniff * @since 7.1.3 Allows for closures. * @since 10.0.0 Allows for PHP 7.4+ arrow functions. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php index acc59261..0f71c0c8 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php @@ -35,7 +35,7 @@ class ForbiddenParametersWithSameNameSniff extends Sniff * @since 7.1.3 Allows for closures. * @since 10.0.0 Allows for PHP 7.4+ arrow functions. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php index a6c4f762..6f514172 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php @@ -36,7 +36,7 @@ class ForbiddenToStringParametersSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php index 4eb4d3a1..f8f8b0c1 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php @@ -39,7 +39,7 @@ class ForbiddenVariableNamesInClosureUseSniff extends Sniff * * @since 7.1.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php index 6ca78d75..db9add6d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php @@ -49,7 +49,7 @@ class NewClosureSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php index 4d2a91e4..af3572c2 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php @@ -39,7 +39,7 @@ class NewExceptionsFromToStringSniff extends Sniff * * @since 9.3.0 * - * @var array + * @var array */ private $docblockIgnoreTokens = [ \T_WHITESPACE => \T_WHITESPACE, @@ -50,7 +50,7 @@ class NewExceptionsFromToStringSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php index 76db6e14..1c3588cc 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php @@ -41,7 +41,7 @@ class NewNullableTypesSniff extends Sniff * @since 7.0.7 * @since 10.0.0 Allows for PHP 7.4+ arrow functions. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php index 1b8f5566..de59df28 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php @@ -74,7 +74,7 @@ class NewParamTypeDeclarationsSniff extends Sniff * @since 7.0.0 * @since 7.0.3 Now lists all param type declarations, not just the PHP 7+ scalar ones. * - * @var array(string => array(string => bool)) + * @var array> */ protected $newTypes = [ 'array' => [ @@ -144,7 +144,7 @@ class NewParamTypeDeclarationsSniff extends Sniff * * @since 7.0.3 * - * @var array(string => string) + * @var array */ protected $invalidTypes = [ 'static' => 'self', @@ -157,7 +157,7 @@ class NewParamTypeDeclarationsSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var array */ protected $unionOnlyTypes = [ 'false' => true, @@ -172,7 +172,7 @@ class NewParamTypeDeclarationsSniff extends Sniff * @since 7.1.3 Now also checks closures. * @since 10.0.0 Now also checks PHP 7.4+ arrow functions. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php index 82cd6d7e..760aebeb 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php @@ -64,7 +64,7 @@ class NewReturnTypeDeclarationsSniff extends Sniff * * @since 7.0.0 * - * @var array(string => array(string => bool)) + * @var array> */ protected $newTypes = [ 'int' => [ @@ -152,7 +152,7 @@ class NewReturnTypeDeclarationsSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var array */ protected $unionOnlyTypes = [ 'false' => true, @@ -164,7 +164,7 @@ class NewReturnTypeDeclarationsSniff extends Sniff * * @since 10.0.0 * - * @var array Key: string type name, value: PHP version in which the type was introduced. + * @var array Key: string type name, value: PHP version in which the type was introduced. */ protected $standAloneTypes = [ 'void' => '7.1', @@ -180,7 +180,7 @@ class NewReturnTypeDeclarationsSniff extends Sniff * @since 7.1.2 Now also checks based on the function and closure keywords. * @since 10.0.0 Now also checks PHP 7.4+ arrow functions. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewTrailingCommaSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewTrailingCommaSniff.php index 3375f2a4..c39863eb 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewTrailingCommaSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewTrailingCommaSniff.php @@ -34,7 +34,7 @@ class NewTrailingCommaSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php index a39c6599..c6deb125 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php @@ -46,7 +46,7 @@ class NonStaticMagicMethodsSniff extends Sniff * @since 5.6 The array format has changed to allow the sniff to also verify the * use of the correct visibility for a magic method. * - * @var array(string) + * @var array> */ protected $magicMethods = [ '__construct' => [ @@ -119,7 +119,7 @@ class NonStaticMagicMethodsSniff extends Sniff * @since 7.1.4 Now also checks anonymous classes. * @since 10.0.0 Switch to check based on T_FUNCTION token instead of OO construct token. * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitSniff.php index 76cc9d80..37a6d2e4 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitSniff.php @@ -40,7 +40,7 @@ class RemovedCallingDestructAfterConstructorExitSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedOptionalBeforeRequiredParamSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedOptionalBeforeRequiredParamSniff.php index 66aa99a4..667c9eb9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedOptionalBeforeRequiredParamSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedOptionalBeforeRequiredParamSniff.php @@ -41,7 +41,7 @@ class RemovedOptionalBeforeRequiredParamSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var array */ private $allowedInDefault = [ \T_NULL => \T_NULL, @@ -52,7 +52,7 @@ class RemovedOptionalBeforeRequiredParamSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedReturnByReferenceFromVoidSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedReturnByReferenceFromVoidSniff.php index 911c5284..1b663413 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedReturnByReferenceFromVoidSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedReturnByReferenceFromVoidSniff.php @@ -35,7 +35,7 @@ class RemovedReturnByReferenceFromVoidSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php index 13793853..2d06770e 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php @@ -47,7 +47,7 @@ class NewMagicMethodsSniff extends Sniff * * @since 7.0.4 * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $newMagicMethods = [ '__construct' => [ @@ -114,7 +114,7 @@ class NewMagicMethodsSniff extends Sniff * * @since 7.0.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php index 49b091f7..dcb9c6fd 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php @@ -44,7 +44,7 @@ class RemovedMagicAutoloadSniff extends Sniff * * @since 8.1.0 * - * @var array + * @var array */ private $checkForScopes = [ \T_NAMESPACE => \T_NAMESPACE, @@ -55,7 +55,7 @@ class RemovedMagicAutoloadSniff extends Sniff * * @since 8.1.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php index 0d6fa1dc..26c1d655 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php @@ -45,7 +45,7 @@ class RemovedNamespacedAssertSniff extends Sniff * * @since 9.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php index f8f85761..7cf25ec1 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php @@ -51,7 +51,7 @@ class RemovedPHP4StyleConstructorsSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php index f474f533..937596e2 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php @@ -37,7 +37,7 @@ class ReservedFunctionNamesSniff implements Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php index e91cff46..5a34aa22 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php @@ -44,7 +44,7 @@ class ArgumentFunctionsReportCurrentValueSniff extends Sniff * * @since 9.1.0 * - * @var array + * @var array */ protected $changedFunctions = [ 'func_get_arg' => true, @@ -58,7 +58,7 @@ class ArgumentFunctionsReportCurrentValueSniff extends Sniff * * @since 9.1.0 * - * @var array + * @var array */ private $skipPastNested = [ 'T_CLASS' => true, @@ -74,7 +74,7 @@ class ArgumentFunctionsReportCurrentValueSniff extends Sniff * * @since 9.1.0 * - * @var array + * @var array */ private $plusPlusMinusMinus = [ \T_DEC => true, @@ -86,7 +86,7 @@ class ArgumentFunctionsReportCurrentValueSniff extends Sniff * * @since 9.1.0 * - * @var array + * @var array */ private $ignoreForStartOfStatement = [ \T_COMMA, @@ -100,7 +100,7 @@ class ArgumentFunctionsReportCurrentValueSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var array */ private $ignoreForStartOfStatementVarUse = [ \T_COMMA, @@ -115,7 +115,7 @@ class ArgumentFunctionsReportCurrentValueSniff extends Sniff * * @since 9.1.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php index c11f29dd..dbb0eac1 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php @@ -42,7 +42,7 @@ class ArgumentFunctionsUsageSniff extends Sniff * * @since 8.2.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'func_get_args' => true, @@ -56,7 +56,7 @@ class ArgumentFunctionsUsageSniff extends Sniff * * @since 8.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php index d8a5bd2e..7651abaa 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php @@ -45,7 +45,7 @@ class NewFunctionParametersSniff extends AbstractFunctionCallParameterSniff * @since 10.0.0 - The parameter offsets were changed from 0-based to 1-based. * - The property was renamed from `$newFunctionParameters` to `$targetFunctions`. * - * @var array + * @var array>> */ protected $targetFunctions = [ 'array_filter' => [ @@ -950,6 +950,13 @@ class NewFunctionParametersSniff extends AbstractFunctionCallParameterSniff '5.3' => true, ], ], + 'strrchr' => [ + 3 => [ + 'name' => 'before_needle', + '8.2' => false, + '8.3' => true, + ], + ], 'strstr' => [ 3 => [ 'name' => 'before_needle', diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php index fdedfad9..116215aa 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php @@ -45,7 +45,7 @@ class NewFunctionsSniff extends Sniff * but that sniff is no longer being extended. * @since 7.0.8 Renamed from `$forbiddenFunctions` to the more descriptive `$newFunctions`. * - * @var array(string => array(string => bool)) + * @var array> */ protected $newFunctions = [ 'class_implements' => [ @@ -4938,6 +4938,56 @@ class NewFunctionsSniff extends Sniff '8.3' => true, 'extension' => 'mbstring', ], + 'pg_set_error_context_visibility' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'pg_enter_pipeline_mode' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'pg_exit_pipeline_mode' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'pg_pipeline_sync' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'pg_pipeline_status' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'pgsql', + ], + 'posix_sysconf' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'posix_pathconf' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'posix_fpathconf' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'posix_eaccess' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'posix', + ], + 'socket_atmark' => [ + '8.2' => false, + '8.3' => true, + 'extension' => 'sockets', + ], ]; @@ -4946,7 +4996,7 @@ class NewFunctionsSniff extends Sniff * * @since 5.6 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewNamedParametersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewNamedParametersSniff.php index 78eab157..28732def 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewNamedParametersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewNamedParametersSniff.php @@ -34,7 +34,7 @@ class NewNamedParametersSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php index cbfa7d89..610a68f3 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php @@ -48,7 +48,7 @@ class OptionalToRequiredFunctionParametersSniff extends AbstractFunctionCallPara * compatibility with the `AbstractFunctionCallParameterSniff` class. * - The parameter offsets were changed from 0-based to 1-based. * - * @var array + * @var array>> */ protected $targetFunctions = [ 'crypt' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php index 1936a869..7dd228dc 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php @@ -51,7 +51,7 @@ class RemovedFunctionParametersSniff extends AbstractFunctionCallParameterSniff * @since 10.0.0 - The parameter offsets were changed from 0-based to 1-based. * - The property was renamed from `$removedFunctionParameters` to `$targetFunctions`. * - * @var array + * @var array>> */ protected $targetFunctions = [ 'curl_version' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php index f2661ea4..6c724f3f 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php @@ -49,7 +49,7 @@ class RemovedFunctionsSniff extends Sniff * but that sniff is no longer being extended. * @since 7.0.8 Property renamed from `$forbiddenFunctions` to `$removedFunctions`. * - * @var array(string => array(string => bool|string|null)) + * @var array> */ protected $removedFunctions = [ 'crack_check' => [ @@ -5082,7 +5082,7 @@ class RemovedFunctionsSniff extends Sniff * * @since 5.6 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php index aa2ae9fe..b087da20 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php @@ -48,7 +48,7 @@ class RequiredToOptionalFunctionParametersSniff extends AbstractFunctionCallPara * compatibility with the `AbstractFunctionCallParameterSniff` class. * - The parameter offsets were changed from 0-based to 1-based. * - * @var array + * @var array>> */ protected $targetFunctions = [ 'array_diff_assoc' => [ @@ -410,7 +410,7 @@ public function processNoParameters(File $phpcsFile, $stackPtr, $functionName) * * @param array $itemArray Version and other information about the item. * - * @return array + * @return array */ protected function getVersionInfo(array $itemArray) { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php index 3cd74087..491a0f70 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php @@ -36,7 +36,7 @@ class NewGeneratorReturnSniff extends Sniff * * @since 9.0.0 * - * @var array + * @var array */ private $validConditions = [ \T_FUNCTION => \T_FUNCTION, @@ -49,7 +49,7 @@ class NewGeneratorReturnSniff extends Sniff * * @since 8.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php index e7156403..2ebcfe03 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php @@ -47,7 +47,7 @@ class NewIniDirectivesSniff extends AbstractFunctionCallParameterSniff * @since 10.0.0 Moved from the base `Sniff` class to this sniff and renamed from * `$iniFunctions` to `$targetFunctions`. * - * @var array + * @var array> */ protected $targetFunctions = [ 'ini_get' => [ @@ -69,7 +69,7 @@ class NewIniDirectivesSniff extends AbstractFunctionCallParameterSniff * @since 5.5 * @since 7.0.3 Support for 'alternative' has been added. * - * @var array(string) + * @var array> */ protected $newIniDirectives = [ 'auto_globals_jit' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php index c01d4525..5e7f43d9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php @@ -49,7 +49,7 @@ class RemovedIniDirectivesSniff extends AbstractFunctionCallParameterSniff * @since 10.0.0 Moved from the base `Sniff` class to this sniff and renamed from * `$iniFunctions` to `$targetFunctions`. * - * @var array + * @var array> */ protected $targetFunctions = [ 'ini_get' => [ @@ -71,7 +71,7 @@ class RemovedIniDirectivesSniff extends AbstractFunctionCallParameterSniff * @since 5.5 * @since 7.0.3 Support for 'alternative' has been added. * - * @var array(string) + * @var array> */ protected $deprecatedIniDirectives = [ 'crack.default_dictionary' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php index ddeafb82..18654082 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php @@ -36,7 +36,7 @@ class NewConstantArraysUsingConstSniff extends Sniff * * @since 7.1.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php index 70fac113..29a9bc58 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php @@ -38,7 +38,7 @@ class NewConstantArraysUsingDefineSniff extends AbstractFunctionCallParameterSni * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'define' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php index ec8ed3ef..40e90ced 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php @@ -56,7 +56,7 @@ class NewConstantScalarExpressionsSniff extends AbstractInitialValueSniff * * @since 8.2.0 * - * @var array + * @var array */ protected $safeOperands = [ \T_LNUMBER => \T_LNUMBER, @@ -81,7 +81,7 @@ class NewConstantScalarExpressionsSniff extends AbstractInitialValueSniff * * @since 8.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php index 34655941..76f4a3f9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php @@ -56,7 +56,7 @@ class NewHeredocSniff extends AbstractInitialValueSniff * @since 8.2.0 * @since 10.0.0 Renamed from `$errorPhrases` to `$initialValueTypes`. * - * @var array + * @var array Type indicator => suggested partial error phrase. */ protected $initialValueTypes = [ 'const' => 'constants', diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewNewInInitializersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewNewInInitializersSniff.php index 4196d7db..81ea7efd 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewNewInInitializersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewNewInInitializersSniff.php @@ -53,7 +53,7 @@ final class NewNewInInitializersSniff extends AbstractInitialValueSniff * * @since 10.0.0. * - * @var array + * @var array Type indicator => suggested partial error phrase. */ protected $initialValueTypes = [ 'const' => 'global/namespaced constants declared using the const keyword', diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php index 2753c46e..d8503729 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php @@ -37,7 +37,7 @@ class InternalInterfacesSniff extends Sniff * * @since 7.0.3 * - * @var array(string => string) + * @var array */ protected $internalInterfaces = [ 'Traversable' => 'shouldn\'t be implemented directly, implement the Iterator or IteratorAggregate interface instead.', @@ -52,7 +52,7 @@ class InternalInterfacesSniff extends Sniff * * @since 10.0.0 * - * @var array(string => bool) + * @var array */ private $cannotBeExtended = [ 'DateTimeInterface' => true, @@ -66,7 +66,7 @@ class InternalInterfacesSniff extends Sniff * * @since 7.0.3 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php index bc488707..4b17d887 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php @@ -46,7 +46,7 @@ class NewInterfacesSniff extends Sniff * * @since 7.0.3 * - * @var array(string => array(string => bool)) + * @var array> */ protected $newInterfaces = [ 'Traversable' => [ @@ -164,7 +164,7 @@ class NewInterfacesSniff extends Sniff * * @since 7.0.3 * - * @var array(string => array(string => string)) + * @var array> */ protected $unsupportedMethods = [ 'Serializable' => [ @@ -178,7 +178,7 @@ class NewInterfacesSniff extends Sniff * * @since 7.0.3 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/RemovedSerializableSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/RemovedSerializableSniff.php index 8e4588e7..f6a883a0 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/RemovedSerializableSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/RemovedSerializableSniff.php @@ -73,7 +73,7 @@ class RemovedSerializableSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var string[] */ private $phpSerializableInterfaces = [ 'serializable', @@ -112,7 +112,7 @@ class RemovedSerializableSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { @@ -342,8 +342,8 @@ private function cleanInterfaceNames($interfaceNames) * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * - * @return array Array with two keys: '__serialize' and '__unserialize'. - * The values are boolean indicators of whether the method declarations were found. + * @return array Array with two keys: '__serialize' and '__unserialize'. + * The values are boolean indicators of whether the method declarations were found. */ private function findMagicMethods($phpcsFile, $stackPtr) { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php index b098b809..164cc55d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php @@ -35,7 +35,7 @@ class CaseSensitiveKeywordsSniff extends Sniff * * @since 7.1.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php index 705680fa..fb84fb23 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php @@ -45,7 +45,7 @@ class ForbiddenNamesSniff extends Sniff * * @since 5.5 * - * @var array(string => string) + * @var array */ protected $invalidNames = [ 'abstract' => '5.0', @@ -133,7 +133,7 @@ class ForbiddenNamesSniff extends Sniff * @since 7.0.8 * @since 10.0.0 Moved from the ForbiddenNamesAsDeclared sniff to this sniff. * - * @var array + * @var array */ protected $otherForbiddenNames = [ 'null' => '7.0', @@ -159,7 +159,7 @@ class ForbiddenNamesSniff extends Sniff * @since 7.0.8 * @since 10.0.0 Moved from the ForbiddenNamesAsDeclared sniff to this sniff. * - * @var array + * @var array */ protected $softReservedNames = [ 'resource' => '7.0', @@ -179,7 +179,7 @@ class ForbiddenNamesSniff extends Sniff * @since 7.0.8 * @since 10.0.0 Moved from the ForbiddenNamesAsDeclared sniff to this sniff. * - * @var array + * @var array */ private $allOtherForbiddenNames = []; @@ -188,7 +188,7 @@ class ForbiddenNamesSniff extends Sniff * * @since 7.0.1 * - * @var array(string => string) + * @var array */ protected $validUseNames = [ 'const' => true, @@ -200,7 +200,7 @@ class ForbiddenNamesSniff extends Sniff * * @since 7.1.4 * - * @var array + * @var array */ private $allowedModifiers = []; @@ -209,7 +209,7 @@ class ForbiddenNamesSniff extends Sniff * * @since 5.5 * - * @var array + * @var array */ protected $targetedTokens = [ \T_NAMESPACE, @@ -229,7 +229,7 @@ class ForbiddenNamesSniff extends Sniff * * @since 5.5 * - * @return array + * @return array */ public function register() { @@ -432,6 +432,9 @@ protected function processNamespaceDeclaration(File $phpcsFile, $stackPtr) * Deal with PHP 8 relaxing the rules. * "The namespace declaration will accept any name, including isolated reserved keywords. * The only restriction is that the namespace name cannot start with a `namespace` segment" + * + * Note: keywords which didn't become reserved prior to PHP 8.0 should never be flagged + * when used in namespace names, as they are not problematic in PHP < 8.0. */ $nextContentLC = \strtolower($tokens[$next]['content']); if (ScannedCode::shouldRunOnOrBelow('7.4') === false @@ -464,16 +467,59 @@ protected function processNamespaceDeclaration(File $phpcsFile, $stackPtr) } foreach ($parts as $part) { - $this->checkName($phpcsFile, $i, $part); - $this->checkOtherName($phpcsFile, $i, $part, 'namespace declaration'); + if ($this->isKeywordReservedPriorToPHP8($part) === true) { + $this->checkName($phpcsFile, $i, $part); + $this->checkOtherName($phpcsFile, $i, $part, 'namespace declaration'); + } } } else { - $this->checkName($phpcsFile, $i, $tokens[$i]['content']); - $this->checkOtherName($phpcsFile, $i, $tokens[$i]['content'], 'namespace declaration'); + if ($this->isKeywordReservedPriorToPHP8($tokens[$i]['content']) === true) { + $this->checkName($phpcsFile, $i, $tokens[$i]['content']); + $this->checkOtherName($phpcsFile, $i, $tokens[$i]['content'], 'namespace declaration'); + } } } } + /** + * Check if a keyword was marked as reserved prior to PHP 8.0. + * + * Helper method for the `processNamespaceDeclaration()` method. + * + * Keywords which didn't become reserved prior to PHP 8.0 should never be flagged + * when used in namespace names, as they are not problematic in PHP < 8.0. + * + * @param string $name The name to check. + * + * @return bool + */ + private function isKeywordReservedPriorToPHP8($name) + { + $nameLC = \strtolower($name); + + if (isset($this->invalidNames[$nameLC]) === true + && $this->invalidNames[$nameLC] !== 'all' + && \version_compare($this->invalidNames[$nameLC], '8.0', '>=') + ) { + return false; + } + + if (isset($this->softReservedNames[$nameLC]) === true + && \version_compare($this->softReservedNames[$nameLC], '8.0', '>=') + ) { + return false; + } + + if (isset($this->otherForbiddenNames[$nameLC]) === true + && isset($this->softReservedNames[$nameLC]) === false + && \version_compare($this->otherForbiddenNames[$nameLC], '8.0', '>=') + ) { + return false; + } + + return true; + } + /** * Processes class/trait/interface declarations. * @@ -518,18 +564,12 @@ protected function processOODeclaration(File $phpcsFile, $stackPtr) */ protected function processFunctionDeclaration(File $phpcsFile, $stackPtr) { - /* - * Deal with PHP 7 relaxing the rules. - * "As of PHP 7.0.0 these keywords are allowed as property, constant, and method names - * of classes, interfaces and traits." - */ - if (Scopes::isOOMethod($phpcsFile, $stackPtr) === true - && ScannedCode::shouldRunOnOrBelow('5.6') === false - ) { + $name = FunctionDeclarations::getName($phpcsFile, $stackPtr); + if (empty($name)) { return; } - $name = FunctionDeclarations::getName($phpcsFile, $stackPtr); + $nameLC = \strtolower($name); /* * Deal with `readonly` being a reserved keyword, but still being allowed @@ -538,7 +578,27 @@ protected function processFunctionDeclaration(File $phpcsFile, $stackPtr) * @link https://github.com/php/php-src/pull/7468 (PHP 8.1) * @link https://github.com/php/php-src/pull/9512 (PHP 8.2 follow-up) */ - if (\strtolower($name) === 'readonly') { + if ($nameLC === 'readonly') { + return; + } + + if (isset($this->invalidNames[$nameLC]) === false) { + return; + } + + /* + * Deal with PHP 7 relaxing the rules. + * "As of PHP 7.0.0 these keywords are allowed as property, constant, and method names + * of classes, interfaces and traits." + * + * Note: keywords which didn't become reserved prior to PHP 7.0 should never be flagged + * when used as method names, as they are not problematic in PHP < 7.0. + */ + if (Scopes::isOOMethod($phpcsFile, $stackPtr) === true + && (ScannedCode::shouldRunOnOrBelow('5.6') === false + || ($this->invalidNames[$nameLC] !== 'all' + && \version_compare($this->invalidNames[$nameLC], '7.0', '>='))) + ) { return; } @@ -575,10 +635,15 @@ protected function processConstDeclaration(File $phpcsFile, $stackPtr) * Deal with PHP 7 relaxing the rules. * "As of PHP 7.0.0 these keywords are allowed as property, constant, and method names * of classes, interfaces and traits, except that class may not be used as constant name." + * + * Note: keywords which didn't become reserved prior to PHP 7.0 should never be flagged + * when used as OO constant names, as they are not problematic in PHP < 7.0. */ if ($nameLc !== 'class' && Scopes::isOOConstant($phpcsFile, $stackPtr) === true - && ScannedCode::shouldRunOnOrBelow('5.6') === false + && (ScannedCode::shouldRunOnOrBelow('5.6') === false + || ($this->invalidNames[$nameLc] !== 'all' + && \version_compare($this->invalidNames[$nameLc], '7.0', '>='))) ) { return; } diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php index 677a0ca2..05261dd4 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php @@ -58,7 +58,7 @@ class NewKeywordsSniff extends Sniff * parent class. This index has been renamed to `callback` and now expect * one of the PHP accepted callback formats. * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $newKeywords = [ 'T_HALT_COMPILER' => [ @@ -172,7 +172,7 @@ class NewKeywordsSniff extends Sniff * * @since 7.0.5 * - * @var array(string => string) + * @var array */ protected $translateContentToToken = []; @@ -182,7 +182,7 @@ class NewKeywordsSniff extends Sniff * * @since 5.5 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php index 69574bb9..34f97552 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php @@ -39,7 +39,7 @@ class NewEmptyNonVariableSniff extends Sniff * * @since 7.0.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php index 0db15141..ba7e99a9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php @@ -41,7 +41,7 @@ class NewLanguageConstructsSniff extends Sniff * * @since 5.6 * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $newConstructs = [ 'T_NS_SEPARATOR' => [ @@ -62,7 +62,7 @@ class NewLanguageConstructsSniff extends Sniff * * @since 5.6 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php index 163d3a07..e048b0e9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php @@ -39,7 +39,7 @@ class AssignmentOrderSniff extends Sniff * * @since 9.0.0 * - * @return array + * @return array */ public function register() { @@ -101,8 +101,8 @@ public function process(File $phpcsFile, $stackPtr) * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. * @param int $stackPtr The position of a list-like token. * - * @return array Array with the variables being assigned to as values and the corresponding - * stack pointer to the start of each variable as keys. + * @return array Array with the variables being assigned to as values and the corresponding + * stack pointer to the start of each variable as keys. * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of * type T_LIST, T_OPEN_SHORT_ARRAY or diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php index 8f5f44f8..6dcd2a03 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php @@ -36,7 +36,7 @@ class ForbiddenEmptyListAssignmentSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php index cf295d52..d7c0da72 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php @@ -36,7 +36,7 @@ class NewKeyedListSniff extends Sniff * * @since 9.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php index fa38f23f..1a4d849d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php @@ -38,7 +38,7 @@ class NewListReferenceAssignmentSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php index 0f7c3294..1fddbc20 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php @@ -38,7 +38,7 @@ class NewShortListSniff extends Sniff * * @since 9.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php index 6d8bfc17..70b80b33 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php @@ -37,7 +37,7 @@ class ForbiddenToStringParametersSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php index fa3e8dd4..a3469043 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php @@ -38,7 +38,7 @@ class NewDirectCallsToCloneSniff extends Sniff * * @since 9.1.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php index 0ce2dee0..8e86ae5b 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php @@ -47,7 +47,7 @@ class NewPHPOpenTagEOFSniff extends Sniff * * @since 9.3.0 * - * @return array + * @return array */ public function register() { @@ -62,7 +62,7 @@ public function register() $targets[] = \T_STRING; } - if (\version_compare(\PHP_VERSION_ID, '70399', '>')) { + if (\PHP_VERSION_ID >= 70400) { $targets[] = \T_OPEN_TAG; } diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php index a0b27778..48f02757 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php @@ -45,11 +45,11 @@ class RemovedAlternativePHPTagsSniff extends Sniff * * @since 7.0.4 * - * @return array + * @return array */ public function register() { - if (\version_compare(\PHP_VERSION_ID, '70000', '<') === true) { + if (\PHP_VERSION_ID < 70000) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.asp_tagsRemoved $this->aspTags = (bool) \ini_get('asp_tags'); } diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Namespaces/ReservedNamesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Namespaces/ReservedNamesSniff.php index 6a18c55b..8ae666f3 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Namespaces/ReservedNamesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Namespaces/ReservedNamesSniff.php @@ -57,7 +57,7 @@ class ReservedNamesSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewExplicitOctalNotationSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewExplicitOctalNotationSniff.php index d28d6009..3f3a32dd 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewExplicitOctalNotationSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewExplicitOctalNotationSniff.php @@ -33,7 +33,7 @@ class NewExplicitOctalNotationSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewNumericLiteralSeparatorSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewNumericLiteralSeparatorSniff.php index c3fa6e8d..fb13c533 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewNumericLiteralSeparatorSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/NewNumericLiteralSeparatorSniff.php @@ -35,7 +35,7 @@ class NewNumericLiteralSeparatorSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/RemovedHexadecimalNumericStringsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/RemovedHexadecimalNumericStringsSniff.php index d343ccbb..2862c9c8 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/RemovedHexadecimalNumericStringsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/RemovedHexadecimalNumericStringsSniff.php @@ -46,10 +46,10 @@ class RemovedHexadecimalNumericStringsSniff extends Sniff * * @since 10.0.0 * - * @var array True if all arguments in the function call accept hex numeric - * strings. An array with 1-based parameter position (key) and - * names (value) for those functions which only accept - * hex numeric strings for select parameters. + * @var array|true> True if all arguments in the function call accept hex numeric + * strings. An array with 1-based parameter position (key) and + * names (value) for those functions which only accept + * hex numeric strings for select parameters. */ private $excludedFunctions = [ 'gmp_abs' => true, @@ -107,7 +107,7 @@ class RemovedHexadecimalNumericStringsSniff extends Sniff * * @since 7.0.3 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/ValidIntegersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/ValidIntegersSniff.php index 58520e13..56038f53 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/ValidIntegersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Numbers/ValidIntegersSniff.php @@ -43,7 +43,7 @@ class ValidIntegersSniff extends Sniff * * @since 7.0.3 * - * @return array + * @return array */ public function register() { @@ -160,9 +160,9 @@ private function getBinaryInteger(File $phpcsFile, $tokens, $stackPtr) * * @since 7.0.3 * - * @param array $tokens Token stack. - * @param int $stackPtr The current position in the token stack. - * @param string $numberInfo The information on the number to examine + * @param array $tokens Token stack. + * @param int $stackPtr The current position in the token stack. + * @param array $numberInfo The information on the number to examine * * @return string|bool The invalid octal as a string or false when this is not an invalid octal. */ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php index f5f9b4c5..01ff13ba 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php @@ -44,7 +44,7 @@ class ChangedConcatOperatorPrecedenceSniff extends Sniff * * @since 9.2.0 * - * @var array + * @var array */ private $tokensWithLowerPrecedence = [ 'T_BITWISE_AND' => true, @@ -63,7 +63,7 @@ class ChangedConcatOperatorPrecedenceSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php index 9c2df5ff..fe2ae054 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php @@ -40,7 +40,7 @@ class ForbiddenNegativeBitshiftSniff extends Sniff * * @since 8.2.0 * - * @var array + * @var array */ private $inclusiveStopPoints = [ \T_COLON => true, @@ -55,7 +55,7 @@ class ForbiddenNegativeBitshiftSniff extends Sniff * @since 7.0.0 * @since 8.2.0 Now registers all bitshift tokens, not just bitshift right (`T_SR`). * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php index 8c93881d..a64c6786 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php @@ -42,7 +42,7 @@ class NewOperatorsSniff extends Sniff * * @since 5.6 * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $newOperators = [ 'T_POW' => [ @@ -82,7 +82,7 @@ class NewOperatorsSniff extends Sniff * * @since 5.6 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php index 8566e3fd..ebd67030 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php @@ -38,7 +38,7 @@ class NewShortTernarySniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php index cccf87b9..ec751ee2 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php @@ -39,7 +39,7 @@ class RemovedTernaryAssociativitySniff extends Sniff * * @since 9.2.0 * - * @var array + * @var array */ private $tokensWithLowerPrecedence = [ 'T_YIELD_FROM' => true, @@ -55,7 +55,7 @@ class RemovedTernaryAssociativitySniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php index 20c6e357..cd0eb538 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php @@ -35,7 +35,7 @@ class ChangedIntToBoolParamTypeSniff extends AbstractFunctionCallParameterSniff * * @since 10.0.0 * - * @var array + * @var array>> */ protected $targetFunctions = [ 'ob_implicit_flush' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedObStartEraseFlagsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedObStartEraseFlagsSniff.php index bc46eab4..e72d93c2 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedObStartEraseFlagsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedObStartEraseFlagsSniff.php @@ -39,7 +39,7 @@ class ChangedObStartEraseFlagsSniff extends AbstractFunctionCallParameterSniff * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'ob_start' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php index bd9c6b85..828e4d8a 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php @@ -34,7 +34,7 @@ class ForbiddenGetClassNullSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'get_class' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenSessionModuleNameUserSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenSessionModuleNameUserSniff.php index 8aeaf13f..2671b72d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenSessionModuleNameUserSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenSessionModuleNameUserSniff.php @@ -37,7 +37,7 @@ class ForbiddenSessionModuleNameUserSniff extends AbstractFunctionCallParameterS * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'session_module_name' => true, @@ -50,7 +50,7 @@ class ForbiddenSessionModuleNameUserSniff extends AbstractFunctionCallParameterS * * @since 10.0.0 * - * @var array + * @var array */ private $targetTokens = []; @@ -59,7 +59,7 @@ class ForbiddenSessionModuleNameUserSniff extends AbstractFunctionCallParameterS * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php index 2e8a1e80..2f53b9cf 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php @@ -33,7 +33,7 @@ class ForbiddenStripTagsSelfClosingXHTMLSniff extends AbstractFunctionCallParame * * @since 9.3.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'strip_tags' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayMergeRecursiveWithGlobalsVarSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayMergeRecursiveWithGlobalsVarSniff.php index b1146f53..1190f67c 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayMergeRecursiveWithGlobalsVarSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayMergeRecursiveWithGlobalsVarSniff.php @@ -33,7 +33,7 @@ final class NewArrayMergeRecursiveWithGlobalsVarSniff extends AbstractFunctionCa * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'array_merge_recursive' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php index fff66a59..6eb84a10 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php @@ -34,7 +34,7 @@ class NewArrayReduceInitialTypeSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'array_reduce' => true, @@ -46,7 +46,7 @@ class NewArrayReduceInitialTypeSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ private $variableValueTokens = [ \T_VARIABLE, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewAssertCustomExceptionSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewAssertCustomExceptionSniff.php index e49927a6..8f98186a 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewAssertCustomExceptionSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewAssertCustomExceptionSniff.php @@ -36,7 +36,7 @@ class NewAssertCustomExceptionSniff extends AbstractFunctionCallParameterSniff * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'assert' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php index 777c527f..a5f0ce60 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php @@ -32,7 +32,7 @@ class NewFopenModesSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'fopen' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php index 1f6cf644..4d7954cb 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php @@ -39,7 +39,7 @@ class NewHTMLEntitiesEncodingDefaultSniff extends AbstractFunctionCallParameterS * * @since 9.3.0 * - * @var array + * @var array> */ protected $targetFunctions = [ 'html_entity_decode' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesFlagsDefaultSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesFlagsDefaultSniff.php index c57bbadb..67873e2d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesFlagsDefaultSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesFlagsDefaultSniff.php @@ -39,7 +39,7 @@ class NewHTMLEntitiesFlagsDefaultSniff extends AbstractFunctionCallParameterSnif * * @since 10.0.0 * - * @var array + * @var array> */ protected $targetFunctions = [ 'get_html_translation_table' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php index e71df65d..e4a6f97d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php @@ -41,7 +41,7 @@ class NewHashAlgorithmsSniff extends AbstractFunctionCallParameterSniff * * @since 7.0.7 * - * @var array(string => array(string => bool)) + * @var array> */ protected $newAlgorithms = [ 'md2' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php index c635e14b..8c9a4c3e 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php @@ -39,7 +39,7 @@ class NewIDNVariantDefaultSniff extends AbstractFunctionCallParameterSniff * * @since 9.3.0 * - * @var array + * @var array> */ protected $targetFunctions = [ 'idn_to_ascii' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php index 6f38981c..302d47e3 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php @@ -50,7 +50,7 @@ class NewIconvMbstringCharsetDefaultSniff extends AbstractFunctionCallParameterS * * @since 9.3.0 * - * @var array + * @var array> */ protected $targetFunctions = [ 'iconv_mime_decode_headers' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php index 2f91f26d..125c20c9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php @@ -34,7 +34,7 @@ class NewNegativeStringOffsetSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array Function name => 1-based parameter offset of the affected parameters => parameter name. + * @var array> Function name => 1-based parameter offset of the affected parameters => parameter name. */ protected $targetFunctions = [ 'file_get_contents' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNumberFormatMultibyteSeparatorsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNumberFormatMultibyteSeparatorsSniff.php index 5a87b53a..3ce60b79 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNumberFormatMultibyteSeparatorsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNumberFormatMultibyteSeparatorsSniff.php @@ -37,7 +37,7 @@ class NewNumberFormatMultibyteSeparatorsSniff extends AbstractFunctionCallParame * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'number_format' => true, @@ -50,7 +50,7 @@ class NewNumberFormatMultibyteSeparatorsSniff extends AbstractFunctionCallParame * * @since 10.0.0 * - * @var array + * @var array */ private $targetTokens = []; @@ -59,7 +59,7 @@ class NewNumberFormatMultibyteSeparatorsSniff extends AbstractFunctionCallParame * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php index 38a1a062..468b214c 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php @@ -41,8 +41,8 @@ class NewPCREModifiersSniff extends AbstractFunctionCallParameterSniff * @since 8.2.0 * @since 10.0.0 Value changed from an irrelevant value to an array. * - * @var array Key is the function name, value an array containing the 1-based parameter position - * and the official name of the parameter. + * @var array> Key is the function name, value an array containing + * the 1-based parameter position and the official name of the parameter. */ protected $targetFunctions = [ 'preg_filter' => [ @@ -87,7 +87,7 @@ class NewPCREModifiersSniff extends AbstractFunctionCallParameterSniff * * @since 8.2.0 * - * @var array + * @var array> */ protected $newModifiers = [ 'J' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php index a8a0b470..510a5ece 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php @@ -34,7 +34,7 @@ class NewPackFormatSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'pack' => true, @@ -45,7 +45,7 @@ class NewPackFormatSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array Regex pattern => Version array. + * @var array> Regex pattern => Version array. */ protected $newFormats = [ '`([Z])`' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php index 7803b23b..9c4c66c4 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php @@ -41,7 +41,7 @@ class NewPasswordAlgoConstantValuesSniff extends AbstractFunctionCallParameterSn * * @since 9.3.0 * - * @var array + * @var array> */ protected $targetFunctions = [ 'password_hash' => [ @@ -59,7 +59,7 @@ class NewPasswordAlgoConstantValuesSniff extends AbstractFunctionCallParameterSn * * @since 9.3.0 * - * @var array + * @var array */ private $invalidTokenTypes = [ \T_NULL => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php index 339ff833..3602c8e0 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php @@ -37,7 +37,7 @@ class NewProcOpenCmdArraySniff extends AbstractFunctionCallParameterSniff * * @since 9.3.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'proc_open' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php index 91b167dd..492ee8b9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php @@ -35,7 +35,7 @@ class NewStripTagsAllowableTagsArraySniff extends AbstractFunctionCallParameterS * * @since 9.3.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'strip_tags' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedAssertStringAssertionSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedAssertStringAssertionSniff.php index 24d97d0c..84bc6c84 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedAssertStringAssertionSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedAssertStringAssertionSniff.php @@ -44,7 +44,7 @@ class RemovedAssertStringAssertionSniff extends AbstractFunctionCallParameterSni * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'assert' => true, @@ -57,7 +57,7 @@ class RemovedAssertStringAssertionSniff extends AbstractFunctionCallParameterSni * * @since 10.0.0 * - * @var array + * @var array */ private $targetTokens = []; @@ -66,7 +66,7 @@ class RemovedAssertStringAssertionSniff extends AbstractFunctionCallParameterSni * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseSniff.php index 23d703ce..51f6822d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseSniff.php @@ -35,7 +35,7 @@ class RemovedGetDefinedFunctionsExcludeDisabledFalseSniff extends AbstractFuncti * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'get_defined_functions' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php index 91ea7e57..762cb617 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php @@ -42,7 +42,7 @@ class RemovedHashAlgorithmsSniff extends AbstractFunctionCallParameterSniff * * @since 7.0.7 * - * @var array(string => array(string => bool)) + * @var array> */ protected $removedAlgorithms = [ 'salsa10' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php index 4e02705a..40059496 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php @@ -39,7 +39,7 @@ class RemovedIconvEncodingSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'iconv_set_encoding' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php index 85ceddec..ef50c6ca 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php @@ -39,7 +39,7 @@ class RemovedImplodeFlexibleParamOrderSniff extends AbstractFunctionCallParamete * * @since 9.3.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'implode' => true, @@ -51,7 +51,7 @@ class RemovedImplodeFlexibleParamOrderSniff extends AbstractFunctionCallParamete * * @since 9.3.0 * - * @var array + * @var array */ private $constantStrings = [ 'DIRECTORY_SEPARATOR' => true, @@ -65,7 +65,7 @@ class RemovedImplodeFlexibleParamOrderSniff extends AbstractFunctionCallParamete * * @since 9.3.0 * - * @var array + * @var array */ private $arrayFunctions = [ 'compact' => true, @@ -78,7 +78,7 @@ class RemovedImplodeFlexibleParamOrderSniff extends AbstractFunctionCallParamete * * @since 9.3.0 * - * @var array + * @var array */ private $arrayFunctionExceptions = [ 'array_key_exists' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbCheckEncodingNoArgsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbCheckEncodingNoArgsSniff.php index 2261a63b..fc7aabb1 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbCheckEncodingNoArgsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbCheckEncodingNoArgsSniff.php @@ -35,7 +35,7 @@ class RemovedMbCheckEncodingNoArgsSniff extends AbstractFunctionCallParameterSni * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'mb_check_encoding' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php index 52ed9c2c..52017dcd 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php @@ -49,7 +49,7 @@ class RemovedMbStrrposEncodingThirdParamSniff extends AbstractFunctionCallParame * * @since 9.3.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'mb_strrpos' => true, @@ -60,7 +60,7 @@ class RemovedMbStrrposEncodingThirdParamSniff extends AbstractFunctionCallParame * * @since 9.3.0 * - * @var array + * @var array */ private $numberTokens = [ \T_LNUMBER => \T_LNUMBER, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php index 116213b0..18c05059 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php @@ -44,7 +44,7 @@ class RemovedMbstringModifiersSniff extends AbstractFunctionCallParameterSniff * @since 7.0.5 * @since 8.2.0 Renamed from `$functions` to `$targetFunctions`. * - * @var array + * @var array */ protected $targetFunctions = [ 'mb_ereg_replace' => 4, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php index 47efc44e..06b6c1a3 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php @@ -37,7 +37,7 @@ class RemovedNonCryptoHashSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'hash_hmac' => true, @@ -51,7 +51,7 @@ class RemovedNonCryptoHashSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $disabledCryptos = [ 'adler32' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php index e99824ce..0600ab5c 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php @@ -52,8 +52,8 @@ class RemovedPCREModifiersSniff extends AbstractFunctionCallParameterSniff * @since 8.2.0 Renamed from `$functions` to `$targetFunctions`. * @since 10.0.0 Value changed from an irrelevant value to an array. * - * @var array Key is the function name, value an array containing the 1-based parameter position - * and the official name of the parameter. + * @var array> Key is the function name, value an array containing + * the 1-based parameter position and the official name of the parameter. */ protected $targetFunctions = [ 'preg_replace' => [ diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php index 4813119c..6bd96325 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php @@ -39,7 +39,7 @@ class RemovedSetlocaleStringSniff extends AbstractFunctionCallParameterSniff * * @since 9.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'setlocale' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSplAutoloadRegisterThrowFalseSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSplAutoloadRegisterThrowFalseSniff.php index fe5e40df..802b4e58 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSplAutoloadRegisterThrowFalseSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSplAutoloadRegisterThrowFalseSniff.php @@ -36,7 +36,7 @@ class RemovedSplAutoloadRegisterThrowFalseSniff extends AbstractFunctionCallPara * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'spl_autoload_register' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedVersionCompareOperatorsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedVersionCompareOperatorsSniff.php index fd059c1e..51bb8e87 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedVersionCompareOperatorsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedVersionCompareOperatorsSniff.php @@ -37,7 +37,7 @@ class RemovedVersionCompareOperatorsSniff extends AbstractFunctionCallParameterS * * @since 10.0.0 * - * @var array + * @var array */ protected $targetFunctions = [ 'version_compare' => true, @@ -50,7 +50,7 @@ class RemovedVersionCompareOperatorsSniff extends AbstractFunctionCallParameterS * * @since 10.0.0 * - * @var array + * @var array */ private $unsupportedOperators = [ '' => true, diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php index fcccdb03..8e4562c8 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php @@ -43,7 +43,7 @@ class ForbiddenCallTimePassByReferenceSniff extends Sniff * * @since 8.1.0 * - * @var array + * @var array */ private $assignOrCompare = []; @@ -52,7 +52,7 @@ class ForbiddenCallTimePassByReferenceSniff extends Sniff * * @since 5.5 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php index c85a550a..b324fd42 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php @@ -46,7 +46,7 @@ class NewArrayStringDereferencingSniff extends Sniff * * @since 7.1.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php index 8ff12bfb..04b93e8a 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php @@ -35,7 +35,7 @@ class NewArrayUnpackingSniff extends Sniff * * @since 10.0.0 * - * @var array + * @var array */ private $arrayTokens = [ \T_ARRAY => \T_ARRAY, @@ -48,7 +48,7 @@ class NewArrayUnpackingSniff extends Sniff * * @since 9.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php index 6cb2d333..b2217b3c 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php @@ -47,7 +47,7 @@ class NewClassMemberAccessSniff extends Sniff * * @since 8.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php index d6c92ec1..d7f11c12 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php @@ -36,7 +36,7 @@ class NewDynamicAccessToStaticSniff extends Sniff * * @since 8.1.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFirstClassCallablesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFirstClassCallablesSniff.php index a751f00b..d0b181db 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFirstClassCallablesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFirstClassCallablesSniff.php @@ -33,7 +33,7 @@ final class NewFirstClassCallablesSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php index 0396d1d1..b3f68e2c 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php @@ -38,7 +38,7 @@ class NewFlexibleHeredocNowdocSniff extends Sniff * * @since 9.0.0 * - * @return array + * @return array */ public function register() { @@ -47,7 +47,7 @@ public function register() \T_END_NOWDOC, ]; - if (\version_compare(\PHP_VERSION_ID, '70299', '>') === false) { + if (\PHP_VERSION_ID < 70300) { // Start identifier of a PHP 7.3 flexible heredoc/nowdoc. $targets[] = \T_STRING; } @@ -99,7 +99,7 @@ protected function detectIndentedNonStandAloneClosingMarker(File $phpcsFile, $st $trailingError = 'Having code - other than a semi-colon or new line - after the closing marker of a heredoc/nowdoc is not supported in PHP 7.2 or earlier.'; $trailingErrorCode = 'ClosingMarkerNoNewLine'; - if (\version_compare(\PHP_VERSION_ID, '70299', '>') === true) { + if (\PHP_VERSION_ID >= 70300) { /* * Check for indented closing marker. */ @@ -185,7 +185,7 @@ protected function detectClosingMarkerInBody(File $phpcsFile, $stackPtr) $error = 'The body of a heredoc/nowdoc can not contain the heredoc/nowdoc closing marker as text at the start of a line since PHP 7.3.'; $errorCode = 'ClosingMarkerNoNewLine'; - if (\version_compare(\PHP_VERSION_ID, '70299', '>') === true) { + if (\PHP_VERSION_ID >= 70300) { $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($stackPtr + 1), null, true, null, true); if ($nextNonWhitespace === false || $tokens[$nextNonWhitespace]['code'] === \T_SEMICOLON diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php index 0091594c..e0d80e0e 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php @@ -46,7 +46,7 @@ class NewFunctionArrayDereferencingSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php index 50eaabff..c0126913 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php @@ -35,7 +35,7 @@ class NewFunctionCallTrailingCommaSniff extends Sniff * * @since 8.2.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewInterpolatedStringDereferencingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewInterpolatedStringDereferencingSniff.php index c7ac5436..e3cda712 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewInterpolatedStringDereferencingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewInterpolatedStringDereferencingSniff.php @@ -35,7 +35,7 @@ class NewInterpolatedStringDereferencingSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewMagicConstantDereferencingSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewMagicConstantDereferencingSniff.php index 10b13ebf..8f476d65 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewMagicConstantDereferencingSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewMagicConstantDereferencingSniff.php @@ -33,7 +33,7 @@ class NewMagicConstantDereferencingSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewNestedStaticAccessSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewNestedStaticAccessSniff.php index e013d755..5e8f9192 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewNestedStaticAccessSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewNestedStaticAccessSniff.php @@ -38,7 +38,7 @@ class NewNestedStaticAccessSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php index 8fd2db6b..74053f64 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php @@ -35,7 +35,7 @@ class NewShortArraySniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php index 5220a488..81de3820 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php @@ -44,11 +44,11 @@ class RemovedCurlyBraceArrayAccessSniff extends Sniff private $newArrayStringDereferencing; /** - * Target tokens as register by the NewArrayStringDereferencing sniff. + * Target tokens as registered by the NewArrayStringDereferencing sniff. * * @since 9.3.0 * - * @var array + * @var array */ private $newArrayStringDereferencingTargets; @@ -62,11 +62,11 @@ class RemovedCurlyBraceArrayAccessSniff extends Sniff private $newClassMemberAccess; /** - * Target tokens as register by the NewClassMemberAccess sniff. + * Target tokens as registered by the NewClassMemberAccess sniff. * * @since 9.3.0 * - * @var array + * @var array */ private $newClassMemberAccessTargets; @@ -80,11 +80,11 @@ class RemovedCurlyBraceArrayAccessSniff extends Sniff private $newFunctionArrayDereferencing; /** - * Target tokens as register by the NewFunctionArrayDereferencing sniff. + * Target tokens as registered by the NewFunctionArrayDereferencing sniff. * * @since 9.3.0 * - * @var array + * @var array */ private $newFunctionArrayDereferencingTargets; @@ -107,7 +107,7 @@ public function __construct() * * @since 9.3.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php index cc168cdc..d398ad2f 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php @@ -37,7 +37,7 @@ class RemovedNewReferenceSniff extends Sniff * * @since 5.5 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php index 284b0f83..ba805420 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php @@ -39,7 +39,7 @@ class NewUnicodeEscapeSequenceSniff extends Sniff * * @since 9.3.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/RemovedDollarBraceStringEmbedsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/RemovedDollarBraceStringEmbedsSniff.php index 58fbcc1d..b264d84d 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/RemovedDollarBraceStringEmbedsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/RemovedDollarBraceStringEmbedsSniff.php @@ -42,7 +42,7 @@ class RemovedDollarBraceStringEmbedsSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php index 2d316c89..7e3a9deb 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php @@ -37,7 +37,7 @@ class NewTypeCastsSniff extends Sniff * * @since 8.0.1 * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $newTypeCasts = [ 'T_UNSET_CAST' => [ @@ -58,7 +58,7 @@ class NewTypeCastsSniff extends Sniff * * @since 8.0.1 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php index a76df4d5..bb5b9671 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php @@ -41,7 +41,7 @@ class RemovedTypeCastsSniff extends Sniff * * @since 8.0.1 * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $deprecatedTypeCasts = [ 'T_UNSET_CAST' => [ @@ -64,7 +64,7 @@ class RemovedTypeCastsSniff extends Sniff * * @since 8.0.1 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php index a5100b91..05276afb 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php @@ -74,7 +74,7 @@ class LowPHPSniff extends Sniff * * @since 9.3.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php index e58187b4..87d48f10 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php @@ -42,7 +42,7 @@ class NewGroupUseDeclarationsSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php index 4dd80c41..59b814d9 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php @@ -39,7 +39,7 @@ class NewUseConstFunctionSniff extends Sniff * * @since 7.1.4 * - * @var array(string => string) + * @var array */ protected $validUseNames = [ 'const' => true, @@ -51,7 +51,7 @@ class NewUseConstFunctionSniff extends Sniff * * @since 7.1.4 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php index 43d6a74f..dc32c550 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php @@ -34,7 +34,7 @@ class ForbiddenGlobalVariableVariableSniff extends Sniff * * @since 7.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php index b71efaa9..19758f49 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php @@ -60,7 +60,7 @@ class ForbiddenThisUseContextsSniff extends Sniff * * @since 9.1.0 * - * @var array + * @var array */ private $skipOverScopes = [ \T_FUNCTION => true, @@ -72,7 +72,7 @@ class ForbiddenThisUseContextsSniff extends Sniff * * @since 9.1.0 * - * @var array + * @var array */ private $validUseOutsideObject = [ \T_ISSET => true, @@ -84,7 +84,7 @@ class ForbiddenThisUseContextsSniff extends Sniff * * @since 9.1.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php index 8c9c8e5a..c6f76b97 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php @@ -35,7 +35,7 @@ class NewUniformVariableSyntaxSniff extends Sniff * * @since 7.1.2 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedIndirectModificationOfGlobalsSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedIndirectModificationOfGlobalsSniff.php index 0829e5d6..dfb279f7 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedIndirectModificationOfGlobalsSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedIndirectModificationOfGlobalsSniff.php @@ -65,7 +65,7 @@ final class RemovedIndirectModificationOfGlobalsSniff extends Sniff * * @since 10.0.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php index 663712f6..10b700c2 100644 --- a/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php +++ b/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php @@ -51,7 +51,7 @@ class RemovedPredefinedGlobalVariablesSniff extends Sniff * @since 5.5 * @since 7.0 * - * @var array(string => array(string => bool|string)) + * @var array> */ protected $removedGlobalVariables = [ 'HTTP_POST_VARS' => [ @@ -110,7 +110,7 @@ class RemovedPredefinedGlobalVariablesSniff extends Sniff * @since 5.5 * @since 7.0 * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcompatibility/php-compatibility/composer.json b/vendor/phpcompatibility/php-compatibility/composer.json index bdafce15..0bb721ad 100644 --- a/vendor/phpcompatibility/php-compatibility/composer.json +++ b/vendor/phpcompatibility/php-compatibility/composer.json @@ -23,7 +23,8 @@ "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "source": "https://github.com/PHPCompatibility/PHPCompatibility", + "security": "https://github.com/PHPCompatibility/PHPCompatibility/security/policy" }, "require": { "php": ">=5.4", diff --git a/vendor/phpcsstandards/phpcsextra/CHANGELOG.md b/vendor/phpcsstandards/phpcsextra/CHANGELOG.md index d2fffeb6..3ee3258b 100644 --- a/vendor/phpcsstandards/phpcsextra/CHANGELOG.md +++ b/vendor/phpcsstandards/phpcsextra/CHANGELOG.md @@ -14,6 +14,50 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses _Nothing yet._ +## [1.2.1] - 2023-12-08 + +### Changed + +#### Other + +* Composer: The minimum `PHP_CodeSniffer` requirement has been updated to `^3.8.0` (was `^3.7.2`). [#298] +* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.9` (was `^1.0.8`). [#298] + +Please ensure you run `composer update phpcsstandards/phpcsextra --with-dependencies` to benefit from this. + +[#298]: https://github.com/PHPCSStandards/PHPCSExtra/pull/298 + + +## [1.2.0] - 2023-12-02 + +### Added + +#### Universal + +* :wrench: :books: New `Universal.CodeAnalysis.NoDoubleNegative` sniff to detect double negatives (!!) and advise to use a boolean cast instead. Thanks [@diedexx] for reviewing. [#277] +* :wrench: :books: New `Universal.Operators.ConcatPosition` sniff to enforce that the concatenation operator for multi-line concatenations is in a preferred position, either always at the start of the next line or always at the end of the previous line. [#294] +* :wrench: :bar_chart: :books: New `Universal.PHP.LowercasePHPTag` sniff to enforce that the "PHP" in a PHP open tag is lowercase. Thanks [@fredden] for reviewing. [#276] + +### Changed + +#### NormalizedArrays + +* `NormalizedArrays.Arrays.CommaAfterLast`: the sniff now has two extra error codes to distinguish between multi-line arrays with the last array item on the _same line_ as the array closer vs the last array item being on a line _before_ the array closer. Thanks [@stronk7] for suggesting and patching this. [#283], [#284] + These new error codes allow for selectively excluding that specific situation from triggering the sniff. + The new error codes are `FoundMultiLineCloserSameLine` (for `multiLine="forbid"`) and `MissingMultiLineCloserSameLine` (for `multiLine="enforce"`). + The pre-existing `FoundMultiLine` and `FoundSingleLine` error codes continue to be used for multi-line arrays with the last array item on a different line than the array closer. + +#### Other + +* Various housekeeping. + +[#276]: https://github.com/PHPCSStandards/PHPCSExtra/pull/276 +[#277]: https://github.com/PHPCSStandards/PHPCSExtra/pull/277 +[#283]: https://github.com/PHPCSStandards/PHPCSExtra/issues/283 +[#284]: https://github.com/PHPCSStandards/PHPCSExtra/pull/284 +[#294]: https://github.com/PHPCSStandards/PHPCSExtra/pull/294 + + ## [1.1.2] - 2023-09-21 ### Changed @@ -520,9 +564,11 @@ This initial alpha release contains the following sniffs: Individual sub-types can be allowed by excluding specific error codes. [Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer -[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version +[php_version-config]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version [Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD +[1.2.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.2...1.2.0 [1.1.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.1...1.1.2 [1.1.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.0...1.1.1 [1.1.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.4...1.1.0 @@ -537,5 +583,8 @@ This initial alpha release contains the following sniffs: [@anomiex]: https://github.com/anomiex [@derickr]: https://github.com/derickr +[@diedexx]: https://github.com/diedexx +[@fredden]: https://github.com/fredden [@GaryJones]: https://github.com/GaryJones +[@stronk7]: https://github.com/stronk7 [@szepeviktor]: https://github.com/szepeviktor diff --git a/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml b/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml index 57e341ba..c30d745d 100644 --- a/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml +++ b/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml @@ -1,5 +1,5 @@ - + A collection of sniffs to detect code modernization opportunities. diff --git a/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php b/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php index d03d1ffc..7384421d 100644 --- a/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php +++ b/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php @@ -145,6 +145,13 @@ public function process(File $phpcsFile, $stackPtr) return; } + // If the closer is on the same line as the last element, change the error code for multi-line arrays. + if ($errorCode === 'MultiLine' + && $tokens[$lastNonEmpty]['line'] === $tokens[$closer]['line'] + ) { + $errorCode .= 'CloserSameLine'; + } + $isComma = ($tokens[$lastNonEmpty]['code'] === \T_COMMA); $phpcsFile->recordMetric( diff --git a/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml b/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml index ce35adb5..69c54a8e 100644 --- a/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml +++ b/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml @@ -1,5 +1,5 @@ - + A ruleset for PHP_CodeSniffer to check arrays for normalized format. diff --git a/vendor/phpcsstandards/phpcsextra/README.md b/vendor/phpcsstandards/phpcsextra/README.md index 22ba5382..a82fa893 100644 --- a/vendor/phpcsstandards/phpcsextra/README.md +++ b/vendor/phpcsstandards/phpcsextra/README.md @@ -9,12 +9,13 @@ PHPCSExtra [![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcsstandards/phpcsextra#dev-develop) [![Last Commit to Unstable](https://img.shields.io/github/last-commit/PHPCSStandards/PHPCSExtra/develop.svg)](https://github.com/PHPCSStandards/PHPCSExtra/commits/develop) -[![Minimum PHP Version](https://img.shields.io/packagist/php-v/phpcsstandards/phpcsextra.svg?maxAge=3600)][phpcsextra-packagist] [![CS Build Status](https://github.com/PHPCSStandards/PHPCSExtra/actions/workflows/basics.yml/badge.svg?branch=develop)][gha-qa-results] [![Test Build Status](https://github.com/PHPCSStandards/PHPCSExtra/actions/workflows/test.yml/badge.svg?branch=develop)][gha-test-results] -[![Tested on PHP 5.4 to 8.2](https://img.shields.io/badge/tested%20on-PHP%205.4%20|%205.5%20|%205.6%20|%207.0%20|%207.1%20|%207.2%20|%207.3%20|%207.4%20|%208.0%20|%208.1%20|%208.2-brightgreen.svg?maxAge=2419200)][gha-test-results] [![Coverage Status](https://coveralls.io/repos/github/PHPCSStandards/PHPCSExtra/badge.svg)](https://coveralls.io/github/PHPCSStandards/PHPCSExtra) +[![Minimum PHP Version](https://img.shields.io/packagist/php-v/phpcsstandards/phpcsextra.svg?maxAge=3600)][phpcsextra-packagist] +[![Tested on PHP 5.4 to 8.3](https://img.shields.io/badge/tested%20on-PHP%205.4%20|%205.5%20|%205.6%20|%207.0%20|%207.1%20|%207.2%20|%207.3%20|%207.4%20|%208.0%20|%208.1%20|%208.2%20|%208.3-brightgreen.svg?maxAge=2419200)][gha-test-results] + [![License: LGPLv3](https://poser.pugx.org/phpcsstandards/phpcsextra/license)](https://github.com/PHPCSStandards/PHPCSExtra/blob/stable/LICENSE) ![Awesome](https://img.shields.io/badge/awesome%3F-yes!-brightgreen.svg) @@ -45,8 +46,8 @@ Minimum Requirements ------------------------------------------- * PHP 5.4 or higher. -* [PHP_CodeSniffer][phpcs-gh] version **3.7.1** or higher. -* [PHPCSUtils][phpcsutils-gh] version **1.0.8** or higher. +* [PHP_CodeSniffer][phpcs-gh] version **3.8.0** or higher. +* [PHPCSUtils][phpcsutils-gh] version **1.0.9** or higher. Installation @@ -61,7 +62,7 @@ Installing via Composer is highly recommended. Run the following from the root of your project: ```bash composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -composer require --dev phpcsstandards/phpcsextra:"^1.1.0" +composer require --dev phpcsstandards/phpcsextra:"^1.2.0" ``` ### Composer Global Installation @@ -69,7 +70,7 @@ composer require --dev phpcsstandards/phpcsextra:"^1.1.0" Alternatively, you may want to install this standard globally: ```bash composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -composer global require --dev phpcsstandards/phpcsextra:"^1.1.0" +composer global require --dev phpcsstandards/phpcsextra:"^1.2.0" ``` ### Updating to a newer version @@ -229,6 +230,13 @@ Detects `foreach` control structures which use the same variable for both the ke Note: The fixer will maintain the existing behaviour of the code. This may not be the _intended_ behaviour. +#### `Universal.CodeAnalysis.NoDoubleNegative` :wrench: :books: + +Detects double negation `!!` in code, which is effectively the same as a boolean cast, but with a much higher cognitive load. +Also detects triple negation `!!!`, which is effectively the same as a single negation. + +The sniff has modular error codes to allow for disabling individual checks. The error codes are: `FoundDouble`, `FoundDoubleWithInstanceof` (not auto-fixable) and `FoundTriple`. + #### `Universal.CodeAnalysis.NoEchoSprintf` :wrench: :books: Detects use of the inefficient `echo [v]sprintf(...);` combi. Use `[v]printf()` instead. @@ -360,6 +368,14 @@ Enforce that the names used in a class/enum "implements" statement or an interfa The fixer will separate each name with a comma and one space. If alternative formatting is desired, a sniff which will check and fix the formatting should be added to the ruleset. +#### `Universal.Operators.ConcatPosition` :wrench: :bar_chart: :books: + +Enforce that the concatenation operator for multi-line concatenations is in a preferred position, either always at the start of the next line or always at the end of the previous line. + +* This sniff contains an `allowOnly` property to set the preferred position for the operator. + Accepted values: (string) `"start"` or `"end"`. Defaults to `"start"`. +* Note: mid-line concatenation is still allowed and will not be flagged by this sniff. + #### `Universal.Operators.DisallowLogicalAndOr` :bar_chart: :books: Enforce the use of the boolean `&&` and `||` operators instead of the logical `and`/`or` operators. @@ -391,6 +407,10 @@ Enforce no spaces around the union type and intersection type operators. The available error codes are: `UnionTypeSpacesBefore`, `UnionTypeSpacesAfter`, `IntersectionTypeSpacesBefore`, `IntersectionTypeSpacesAfter`. +#### `Universal.PHP.LowercasePHPTag` :wrench: :bar_chart: :books: + +Enforces that the "PHP" in a PHP open tag is lowercase. + #### `Universal.PHP.OneStatementInShortEchoTag` :wrench: :books: Disallow short open echo tags ` + + + + + + + ! $b; + +if((bool) callMe($a)) {} + ]]> + + + ! ! $b; + +if(! ! ! callMe($a)) {} + ]]> + + + diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml b/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml new file mode 100644 index 00000000..4d2761af --- /dev/null +++ b/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml @@ -0,0 +1,31 @@ + + + + + + + + . $b . 'text' + . $c; + ]]> + + + . + $b . 'text' + . $c; + ]]> + + + diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml b/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml new file mode 100644 index 00000000..261f93cd --- /dev/null +++ b/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php new file mode 100644 index 00000000..549c8cd3 --- /dev/null +++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php @@ -0,0 +1,269 @@ + + */ + private $operatorsWithLowerPrecedence; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.2.0 + * + * @return array + */ + public function register() + { + // Collect all the operators only once. + $this->operatorsWithLowerPrecedence = Tokens::$assignmentTokens; + $this->operatorsWithLowerPrecedence += Tokens::$booleanOperators; + $this->operatorsWithLowerPrecedence += Tokens::$comparisonTokens; + $this->operatorsWithLowerPrecedence += Tokens::$operators; + $this->operatorsWithLowerPrecedence[\T_INLINE_THEN] = \T_INLINE_THEN; + $this->operatorsWithLowerPrecedence[\T_INLINE_ELSE] = \T_INLINE_ELSE; + + return [\T_BOOLEAN_NOT]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.2.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $notCount = 1; + $lastNot = $stackPtr; + for ($afterNot = ($stackPtr + 1); $afterNot < $phpcsFile->numTokens; $afterNot++) { + if (isset(Tokens::$emptyTokens[$tokens[$afterNot]['code']])) { + continue; + } + + if ($tokens[$afterNot]['code'] === \T_BOOLEAN_NOT) { + $lastNot = $afterNot; + ++$notCount; + continue; + } + + break; + } + + if ($notCount === 1) { + // Singular unary not-operator. Nothing to do. + return; + } + + $found = \trim(GetTokensAsString::compact($phpcsFile, $stackPtr, $lastNot)); + $data = [$found]; + + if (($notCount % 2) === 1) { + /* + * Oh dear... silly code time, found a triple negative (or other uneven number), + * this should just be a singular not-operator. + */ + $fix = $phpcsFile->addFixableError( + 'Triple negative (or more) detected. Use a singular not (!) operator instead. Found: %s', + $stackPtr, + 'FoundTriple', + $data + ); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $this->removeNotAndTrailingSpaces($phpcsFile, $stackPtr, $lastNot); + + $phpcsFile->fixer->endChangeset(); + } + + // Only throw one error, even if there are more than two not-operators. + return $lastNot; + } + + /* + * Found a double negative, which should be a boolean cast. + */ + + $fixable = true; + + /* + * If whatever is being "cast" is within parentheses, we're good. + * If not, we need to prevent creating a change in behaviour + * when what follows is an `$x instanceof ...` expression, as + * the "instanceof" operator is right between a boolean cast + * and the ! operator precedence-wise. + * + * Note: this only applies to double negative, not triple negative. + * + * @link https://www.php.net/language.operators.precedence + */ + if ($tokens[$afterNot]['code'] !== \T_OPEN_PARENTHESIS) { + $end = Parentheses::getLastCloser($phpcsFile, $stackPtr); + if ($end === false) { + $end = BCFile::findEndOfStatement($phpcsFile, $stackPtr); + } + + for ($nextRelevant = $afterNot; $nextRelevant < $end; $nextRelevant++) { + if (isset(Tokens::$emptyTokens[$tokens[$nextRelevant]['code']])) { + continue; + } + + if ($tokens[$nextRelevant]['code'] === \T_INSTANCEOF) { + $fixable = false; + break; + } + + if (isset($this->operatorsWithLowerPrecedence[$tokens[$nextRelevant]['code']])) { + // The expression the `!` belongs to has ended. + break; + } + + // Skip over anything within some form of brackets. + if (isset($tokens[$nextRelevant]['scope_closer']) + && ($nextRelevant === $tokens[$nextRelevant]['scope_opener'] + || $nextRelevant === $tokens[$nextRelevant]['scope_condition']) + ) { + $nextRelevant = $tokens[$nextRelevant]['scope_closer']; + continue; + } + + if (isset($tokens[$nextRelevant]['bracket_opener'], $tokens[$nextRelevant]['bracket_closer']) + && $nextRelevant === $tokens[$nextRelevant]['bracket_opener'] + ) { + $nextRelevant = $tokens[$nextRelevant]['bracket_closer']; + continue; + } + + if ($tokens[$nextRelevant]['code'] === \T_OPEN_PARENTHESIS + && isset($tokens[$nextRelevant]['parenthesis_closer']) + ) { + $nextRelevant = $tokens[$nextRelevant]['parenthesis_closer']; + continue; + } + + // Skip over attributes (just in case). + if ($tokens[$nextRelevant]['code'] === \T_ATTRIBUTE + && isset($tokens[$nextRelevant]['attribute_closer']) + ) { + $nextRelevant = $tokens[$nextRelevant]['attribute_closer']; + continue; + } + } + } + + $error = 'Double negative detected. Use a (bool) cast %s instead. Found: %s'; + $code = 'FoundDouble'; + $data = [ + '', + $found, + ]; + + if ($fixable === false) { + $code = 'FoundDoubleWithInstanceof'; + $data[0] = 'and parentheses around the instanceof expression'; + + // Don't auto-fix in combination with instanceof. + $phpcsFile->addError($error, $stackPtr, $code, $data); + + // Only throw one error, even if there are more than two not-operators. + return $lastNot; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code, $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $this->removeNotAndTrailingSpaces($phpcsFile, $stackPtr, $lastNot); + + $phpcsFile->fixer->replaceToken($lastNot, '(bool)'); + + $phpcsFile->fixer->endChangeset(); + } + + // Only throw one error, even if there are more than two not-operators. + return $lastNot; + } + + /** + * Remove boolean not-operators and trailing whitespace after those, + * but don't remove comments or trailing whitespace after comments. + * + * @since 1.2.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $lastNot The position of the last boolean not token + * in the chain. + * + * @return void + */ + private function removeNotAndTrailingSpaces(File $phpcsFile, $stackPtr, $lastNot) + { + $tokens = $phpcsFile->getTokens(); + $ignore = false; + + for ($i = $stackPtr; $i < $lastNot; $i++) { + if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { + // Ignore comments and whitespace after comments. + $ignore = true; + continue; + } + + if ($tokens[$i]['code'] === \T_WHITESPACE && $ignore === false) { + $phpcsFile->fixer->replaceToken($i, ''); + continue; + } + + if ($tokens[$i]['code'] === \T_BOOLEAN_NOT) { + $ignore = false; + $phpcsFile->fixer->replaceToken($i, ''); + } + } + } +} diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php new file mode 100644 index 00000000..093785ad --- /dev/null +++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php @@ -0,0 +1,204 @@ + + */ + public function register() + { + return [\T_STRING_CONCAT]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.2.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process(File $phpcsFile, $stackPtr) + { + /* + * Validate the setting. + */ + if ($this->allowOnly !== self::POSITION_END) { + // Use the default. + $this->allowOnly = self::POSITION_START; + } + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + if ($nextNonEmpty === false) { + // Parse error/live coding. + return; + } + + $tokens = $phpcsFile->getTokens(); + if ($tokens[$prevNonEmpty]['line'] === $tokens[$nextNonEmpty]['line']) { + // Not multi-line concatenation. Not our target. + return; + } + + $position = self::POSITION_STANDALONE; + if ($tokens[$prevNonEmpty]['line'] === $tokens[$stackPtr]['line']) { + $position = self::POSITION_END; + } elseif ($tokens[$nextNonEmpty]['line'] === $tokens[$stackPtr]['line']) { + $position = self::POSITION_START; + } + + // Record metric. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, $position); + + if ($this->allowOnly === $position) { + // All okay. + return; + } + + $fix = $phpcsFile->addFixableError( + 'The concatenation operator for multi-line concatenations should always be at the %s of a line.', + $stackPtr, + 'Incorrect', + [$this->allowOnly] + ); + + if ($fix === true) { + if ($this->allowOnly === self::POSITION_END) { + $phpcsFile->fixer->beginChangeset(); + + // Move the concat operator. + $phpcsFile->fixer->replaceToken($stackPtr, ''); + $phpcsFile->fixer->addContent($prevNonEmpty, ' .'); + + if ($position === self::POSITION_START + && $tokens[($stackPtr + 1)]['code'] === \T_WHITESPACE + ) { + // Remove trailing space. + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } elseif ($position === self::POSITION_STANDALONE) { + // Remove potential indentation space. + if ($tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } + + // Remove new line. + if ($tokens[($stackPtr + 1)]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + } + + $phpcsFile->fixer->endChangeset(); + return; + } + + // Fixer for allowOnly === self::POSITION_START. + $phpcsFile->fixer->beginChangeset(); + + // Move the concat operator. + $phpcsFile->fixer->replaceToken($stackPtr, ''); + $phpcsFile->fixer->addContentBefore($nextNonEmpty, '. '); + + if ($position === self::POSITION_END + && $tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE + ) { + // Remove trailing space. + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } elseif ($position === self::POSITION_STANDALONE) { + // Remove potential indentation space. + if ($tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } + + // Remove new line. + if ($tokens[($stackPtr + 1)]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + } + + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php new file mode 100644 index 00000000..b231b225 --- /dev/null +++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php @@ -0,0 +1,87 @@ + + */ + public function register() + { + return [\T_OPEN_TAG]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.2.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $content = $tokens[$stackPtr]['content']; + $contentLC = \strtolower($content); + + if ($contentLC === $content) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'lowercase'); + return; + } + + $errorCode = ''; + if (\strtoupper($content) === $content) { + $errorCode = 'Uppercase'; + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'uppercase'); + } else { + $errorCode = 'Mixedcase'; + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'mixed case'); + } + + $fix = $phpcsFile->addFixableError( + 'The php open tag should be in lowercase. Found: %s', + $stackPtr, + $errorCode, + [\trim($content)] + ); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLC); + } + } +} diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php index 6d699934..93de596c 100644 --- a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php +++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php @@ -28,15 +28,6 @@ final class NoUselessAliasesSniff implements Sniff { - /** - * Name of the "Use import source" metric. - * - * @since 1.1.0 - * - * @var string - */ - const METRIC_NAME = 'Import use statement type'; - /** * Returns an array of tokens this test wants to listen for. * diff --git a/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml b/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml index 33067f2b..6c591eb7 100644 --- a/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml +++ b/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml @@ -1,5 +1,5 @@ - + A collection of universal sniffs. This standard is not designed to be used to check code. Include individual sniffs from this standard in a custom ruleset instead. diff --git a/vendor/phpcsstandards/phpcsextra/composer.json b/vendor/phpcsstandards/phpcsextra/composer.json index f4bbf2b9..92122571 100644 --- a/vendor/phpcsstandards/phpcsextra/composer.json +++ b/vendor/phpcsstandards/phpcsextra/composer.json @@ -17,19 +17,20 @@ ], "support" : { "issues" : "https://github.com/PHPCSStandards/PHPCSExtra/issues", - "source" : "https://github.com/PHPCSStandards/PHPCSExtra" + "source" : "https://github.com/PHPCSStandards/PHPCSExtra", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy" }, "require" : { "php" : ">=5.4", - "squizlabs/php_codesniffer" : "^3.7.1", - "phpcsstandards/phpcsutils" : "^1.0.8" + "squizlabs/php_codesniffer" : "^3.8.0", + "phpcsstandards/phpcsutils" : "^1.0.9" }, "require-dev" : { "php-parallel-lint/php-parallel-lint": "^1.3.2", "php-parallel-lint/php-console-highlighter": "^1.0", "phpcsstandards/phpcsdevcs": "^1.1.6", "phpcsstandards/phpcsdevtools": "^1.2.1", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "extra": { "branch-alias": { diff --git a/vendor/phpcsstandards/phpcsutils/CHANGELOG.md b/vendor/phpcsstandards/phpcsutils/CHANGELOG.md index 4094d4ab..cc5bb53d 100644 --- a/vendor/phpcsstandards/phpcsutils/CHANGELOG.md +++ b/vendor/phpcsstandards/phpcsutils/CHANGELOG.md @@ -10,6 +10,34 @@ This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and use _Nothing yet._ +## [1.0.9] - 2023-12-08 + +### Added + +#### PHPCS BackCompat + +* `BCFile::getMemberProperties()`: sync with PHPCS 3.8.0 - support for PHP 8.2 `true` type. [#524] +* `BCFile::getMethodProperties()`: sync with PHPCS 3.8.0 - support for PHP 8.2 `true` type. [#524] +* `BCFile::getMethodParameters()`: sync with PHPCS 3.8.0 - support for PHP 8.2 `true` type. [#524] + +### Changed + +#### TestUtils + +* Significant performance improvement for the [`UtilityMethodTestCase`]. [#525] + +#### Other + +* Dropped support for [PHP_CodeSniffer] < 3.8.0. [#523] + Please ensure you run `composer update phpcsstandards/phpcsutils --with-dependencies` to benefit from this. +* Small improvements to the documentation website generation. Includes a contribution from [@fredden]. +* Various housekeeping and documentation improvements. Includes a contribution from [@fredden]. + +[#523]: https://github.com/PHPCSStandards/PHPCSUtils/pull/523 +[#524]: https://github.com/PHPCSStandards/PHPCSUtils/pull/524 +[#525]: https://github.com/PHPCSStandards/PHPCSUtils/pull/525 + + ## [1.0.8] - 2023-07-17 ### Changed @@ -928,6 +956,7 @@ This initial alpha release contains the following utility classes: [Unreleased]: https://github.com/PHPCSStandards/PHPCSUtils/compare/stable...HEAD +[1.0.9]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.8...1.0.9 [1.0.8]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.7...1.0.8 [1.0.7]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.6...1.0.7 [1.0.6]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.5...1.0.6 @@ -943,6 +972,7 @@ This initial alpha release contains the following utility classes: [1.0.0-alpha2]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha1...1.0.0-alpha2 [Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer +[PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer [`AbstractArrayDeclarationSniff`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-AbstractSniffs-AbstractArrayDeclarationSniff.html [`BCFile`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-BackCompat-BCFile.html @@ -973,5 +1003,6 @@ This initial alpha release contains the following utility classes: [`UseStatements`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-UseStatements.html [`Variables`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Variables.html +[@fredden]: https://github.com/fredden [@GaryJones]: https://github.com/GaryJones [@szepeviktor]: https://github.com/szepeviktor diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php index 21420a8e..b79a3fdc 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php @@ -42,7 +42,7 @@ abstract class AbstractArrayDeclarationSniff implements Sniff * * @since 1.0.0 * - * @var array + * @var array> */ protected $tokens; @@ -79,7 +79,7 @@ abstract class AbstractArrayDeclarationSniff implements Sniff * * @since 1.0.0 * - * @var array + * @var array> */ protected $arrayItems; @@ -108,7 +108,7 @@ abstract class AbstractArrayDeclarationSniff implements Sniff * * @since 1.0.0 * - * @var array + * @var array */ private $acceptedTokens = [ \T_NULL => \T_NULL, @@ -152,7 +152,7 @@ final public function __construct() * * @codeCoverageIgnore * - * @return array + * @return array */ public function register() { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php index 030bde4b..af4ec95e 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php @@ -29,7 +29,7 @@ * @author Klaus Purer * * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHPCSUtils\BackCompat; @@ -201,7 +201,7 @@ public static function getDeclarationName(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the stack of the function token * to acquire the parameters for. * - * @return array + * @return array> * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified `$stackPtr` is not of * type `T_FUNCTION`, `T_CLOSURE`, `T_USE`, @@ -362,6 +362,7 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr) case T_TYPE_UNION: case T_TYPE_INTERSECTION: case T_FALSE: + case T_TRUE: case T_NULL: // Part of a type hint or default value. if ($defaultStart === null) { @@ -498,7 +499,7 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr) * * Changelog for the PHPCS native function: * - Introduced in PHPCS 0.0.5. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::getMethodProperties() Original source. * @see \PHPCSUtils\Utils\FunctionDeclarations::getProperties() PHPCSUtils native improved version. @@ -509,7 +510,7 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the stack of the function token to * acquire the properties for. * - * @return array + * @return array * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a * `T_FUNCTION`, `T_CLOSURE`, or `T_FN` token. @@ -543,7 +544,7 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr) * * Changelog for the PHPCS native function: * - Introduced in PHPCS 0.0.5. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::getMemberProperties() Original source. * @see \PHPCSUtils\Utils\Variables::getMemberProperties() PHPCSUtils native improved version. @@ -554,7 +555,7 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the stack of the `T_VARIABLE` token to * acquire the properties for. * - * @return array + * @return array * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a * `T_VARIABLE` token, or if the position is not @@ -573,7 +574,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr) * array( * 'is_abstract' => boolean, // TRUE if the abstract keyword was found. * 'is_final' => boolean, // TRUE if the final keyword was found. - * 'is_readonly' => false, // TRUE if the readonly keyword was found. + * 'is_readonly' => boolean, // TRUE if the readonly keyword was found. * ); * ``` * @@ -593,7 +594,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the stack of the `T_CLASS` * token to acquire the properties for. * - * @return array + * @return array * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a * `T_CLASS` token. @@ -653,7 +654,7 @@ public static function getClassProperties(File $phpcsFile, $stackPtr) * * Changelog for the PHPCS native function: * - Introduced in PHPCS 0.0.5. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::isReference() Original source. * @see \PHPCSUtils\Utils\Operators::isReference() PHPCSUtils native improved version. @@ -679,7 +680,7 @@ public static function isReference(File $phpcsFile, $stackPtr) * * Changelog for the PHPCS native function: * - Introduced in PHPCS 0.0.5. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::getTokensAsString() Original source. * @see \PHPCSUtils\Utils\GetTokensAsString Related set of functions. @@ -708,15 +709,15 @@ public static function getTokensAsString(File $phpcsFile, $start, $length, $orig * * Changelog for the PHPCS native function: * - Introduced in PHPCS 2.1.0. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::findStartOfStatement() Original source. * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $start The position to start searching from in the token stack. - * @param int|string|array $ignore Token types that should not be considered stop points. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $start The position to start searching from in the token stack. + * @param int|string|array $ignore Token types that should not be considered stop points. * * @return int */ @@ -732,15 +733,15 @@ public static function findStartOfStatement(File $phpcsFile, $start, $ignore = n * * Changelog for the PHPCS native function: * - Introduced in PHPCS 2.1.0. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::findEndOfStatement() Original source. * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $start The position to start searching from in the token stack. - * @param int|string|array $ignore Token types that should not be considered stop points. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $start The position to start searching from in the token stack. + * @param int|string|array $ignore Token types that should not be considered stop points. * * @return int */ @@ -756,16 +757,16 @@ public static function findEndOfStatement(File $phpcsFile, $start, $ignore = nul * * Changelog for the PHPCS native function: * - Introduced in PHPCS 0.0.5. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::hasCondition() Original source. * @see \PHPCSUtils\Utils\Conditions::hasCondition() PHPCSUtils native alternative. * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $types The type(s) of tokens to search for. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $types The type(s) of tokens to search for. * * @return bool */ @@ -781,7 +782,7 @@ public static function hasCondition(File $phpcsFile, $stackPtr, $types) * * Changelog for the PHPCS native function: * - Introduced in PHPCS 1.3.0. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::getCondition() Original source. * @see \PHPCSUtils\Utils\Conditions::getCondition() More versatile alternative. @@ -812,7 +813,7 @@ public static function getCondition(File $phpcsFile, $stackPtr, $type, $first = * * Changelog for the PHPCS native function: * - Introduced in PHPCS 1.2.0. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::findExtendedClassName() Original source. * @see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedClassName() PHPCSUtils native improved version. @@ -837,7 +838,7 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr) * * Changelog for the PHPCS native function: * - Introduced in PHPCS 2.7.0. - * - The upstream method has received no significant updates since PHPCS 3.7.1. + * - The upstream method has received no significant updates since PHPCS 3.8.0. * * @see \PHP_CodeSniffer\Files\File::findImplementedInterfaceNames() Original source. * @see \PHPCSUtils\Utils\ObjectDeclarations::findImplementedInterfaceNames() PHPCSUtils native improved version. @@ -847,8 +848,8 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr) * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. * @param int $stackPtr The stack position of the class or enum token. * - * @return array|false Array with names of the implemented interfaces or `FALSE` on - * error or if there are no implemented interface names. + * @return string[]|false Array with names of the implemented interfaces or `FALSE` on + * error or if there are no implemented interface names. */ public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php index 78591164..9424f70c 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php @@ -74,15 +74,15 @@ final class BCTokens /** * Handle calls to (undeclared) methods for token arrays which haven't received any - * changes since PHPCS 3.7.1. + * changes since PHPCS 3.8.0. * * @since 1.0.0 * - * @param string $name The name of the method which has been called. - * @param array $args Any arguments passed to the method. - * Unused as none of the methods take arguments. + * @param string $name The name of the method which has been called. + * @param array $args Any arguments passed to the method. + * Unused as none of the methods take arguments. * - * @return array => Token array + * @return array Token array * * @throws \PHPCSUtils\Exceptions\InvalidTokenArray When an invalid token array is requested. */ @@ -110,7 +110,7 @@ public static function __callStatic($name, $args) * * @since 1.0.0 * - * @return array => Token array. + * @return array Token array. */ public static function functionNameTokens() { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php index c3a30257..7352a8cb 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php @@ -52,7 +52,7 @@ public static function getVersion() * @since 1.0.0 * * @param string $key The name of the config value. - * @param string|null $value The value to set. If `null`, the config entry + * @param mixed $value The value to set. If `null`, the config entry * is deleted, reverting it to the default value. * @param bool $temp Set this config data temporarily for this script run. * This will not write the config data to the config file. diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php index 0e9eed68..4f9e5b4e 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php @@ -29,12 +29,12 @@ final class TestTargetNotFound extends OutOfBoundsException * @param string $content The (optional) target token content. * @param string $file The file in which the target token was not found. * - * @return \PHPCSUtils\Exceptions\TestMarkerNotFound + * @return \PHPCSUtils\Exceptions\TestTargetNotFound */ public static function create($marker, $content, $file) { $contentPhrase = ''; - if ($content !== null) { + if (\is_string($content)) { $contentPhrase = ' with token content: ' . $content; } diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php index 3843f03d..2f7873fe 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php @@ -68,7 +68,8 @@ final class Cache * * @since 1.0.0 * - * @var array> Format: $cache[$loop][$fileName][$key][$id] = mixed $value; + * @var array>>> + * Format: $cache[$loop][$fileName][$key][$id] = mixed $value; */ private static $cache = []; @@ -144,7 +145,7 @@ public static function get(File $phpcsFile, $key, $id) * @param string $key The key to identify a particular set of results. * It is recommended to pass __METHOD__ to this parameter. * - * @return array + * @return array */ public static function getForFile(File $phpcsFile, $key) { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php index f056d623..28a38989 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php @@ -114,7 +114,7 @@ final class IsShortArrayOrList * * @since 1.0.0 * - * @var array + * @var array> */ private $tokens; @@ -168,7 +168,7 @@ final class IsShortArrayOrList * * @since 1.0.0 * - * @return array => + * @var array */ private $openBrackets; diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php index 72f854f0..b1b8c47e 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php @@ -58,7 +58,7 @@ final class IsShortArrayOrListWithCache * * @since 1.0.0 * - * @var array + * @var array> */ private $tokens; diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php index 6e7d08dd..2f7a2478 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php @@ -116,7 +116,7 @@ public static function get($key, $id) * @param string $key The key to identify a particular set of results. * It is recommended to pass `__METHOD__` to this parameter. * - * @return array + * @return array */ public static function getForKey($key) { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php index 7d8d92f0..593392df 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php @@ -46,7 +46,7 @@ final class StableCollections * * @since 1.0.2 * - * @var array => + * @var array */ public static $shortArrayListOpenTokensBC = [ \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, @@ -64,7 +64,7 @@ final class StableCollections * * @since 1.0.2 * - * @var array => + * @var array */ public static $shortArrayListTokensBC = [ \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php index fcc1e75a..2de11a2d 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php @@ -18,6 +18,7 @@ use PHPCSUtils\Exceptions\TestTargetNotFound; use PHPUnit\Framework\TestCase; use ReflectionClass; +use ReflectionProperty; /** * Base class for use when testing utility methods for PHP_CodeSniffer. @@ -154,7 +155,7 @@ abstract class UtilityMethodTestCase extends TestCase * * @since 1.0.0 * - * @var \PHP_CodeSniffer\Files\File + * @var \PHP_CodeSniffer\Files\File|null */ protected static $phpcsFile; @@ -168,7 +169,7 @@ abstract class UtilityMethodTestCase extends TestCase * * @since 1.0.0 * - * @var array + * @var string[] */ protected static $selectedSniff = ['Dummy.Dummy.Dummy']; @@ -208,9 +209,22 @@ public static function setUpTestFile() $contents = \file_get_contents($caseFile); + /* + * Set the static properties in the Config class to specific values for performance + * and to clear out values from other tests. + */ + self::setStaticConfigProperty('executablePaths', []); + + // Set to values which prevent the test-runner user's `CodeSniffer.conf` file + // from being read and influencing the tests. Also prevent an `exec()` call to stty. + self::setStaticConfigProperty('configData', ['report_width' => 80]); + self::setStaticConfigProperty('configDataFile', ''); + $config = new \PHP_CodeSniffer\Config(); /* + * Set to a usable value to circumvent Config trying to find a phpcs.xml config file. + * * We just need to provide a standard so PHPCS will tokenize the file. * The standard itself doesn't actually matter for testing utility methods, * so use the smallest one to get the fastest results. @@ -298,6 +312,27 @@ public static function resetTestFile() self::$tabWidth = 4; self::$phpcsFile = null; self::$selectedSniff = ['Dummy.Dummy.Dummy']; + + // Reset the static properties in the Config class to their defaults to prevent tests influencing each other. + self::setStaticConfigProperty('executablePaths', []); + self::setStaticConfigProperty('configData', null); + self::setStaticConfigProperty('configDataFile', null); + } + + /** + * Helper function to set the value of a private static property on the PHPCS Config class. + * + * @param string $name The name of the property to set. + * @param mixed $value The value to set the property to. + * + * @return void + */ + public static function setStaticConfigProperty($name, $value) + { + $property = new ReflectionProperty('PHP_CodeSniffer\Config', $name); + $property->setAccessible(true); + $property->setValue(null, $value); + $property->setAccessible(false); } /** @@ -329,10 +364,10 @@ public static function usesPhp8NameTokens() * * @since 1.0.0 * - * @param string $commentString The complete delimiter comment to look for as a string. - * This string should include the comment opener and closer. - * @param int|string|array $tokenType The type of token(s) to look for. - * @param string $tokenContent Optional. The token content for the target token. + * @param string $commentString The complete delimiter comment to look for as a string. + * This string should include the comment opener and closer. + * @param int|string|array $tokenType The type of token(s) to look for. + * @param string $tokenContent Optional. The token content for the target token. * * @return int * diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php index 09ed84b4..c8465152 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php @@ -67,7 +67,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::alternativeControlStructureSyntaxes()} method for access. * - * @var array => + * @var array */ private static $alternativeControlStructureSyntaxes = [ \T_IF => \T_IF, @@ -85,7 +85,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::alternativeControlStructureSyntaxClosers()} method for access. * - * @var array => + * @var array */ private static $alternativeControlStructureSyntaxClosers = [ \T_ENDIF => \T_ENDIF, @@ -109,7 +109,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::arrayOpenTokensBC()} method for access. * - * @var array => + * @var array */ private static $arrayOpenTokensBC = [ \T_ARRAY => \T_ARRAY, @@ -128,7 +128,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::arrayTokens()} method for access. * - * @var array => + * @var array */ private static $arrayTokens = [ \T_ARRAY => \T_ARRAY, @@ -141,7 +141,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::classModifierKeywords()} method for access. * - * @var array => + * @var array */ private static $classModifierKeywords = [ \T_FINAL => \T_FINAL, @@ -160,7 +160,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::closedScopes()} method for access. * - * @var array => + * @var array */ private static $closedScopes = [ \T_CLASS => \T_CLASS, @@ -180,7 +180,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::constantModifierKeywords()} method for access. * - * @var array => + * @var array */ private static $constantModifierKeywords = [ \T_PUBLIC => \T_PUBLIC, @@ -194,7 +194,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::controlStructureTokens()} method for access. * - * @var array => + * @var array */ private static $controlStructureTokens = [ \T_IF => \T_IF, @@ -214,7 +214,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::functionDeclarationTokens()} method for access. * - * @var array => + * @var array */ private static $functionDeclarationTokens = [ \T_FUNCTION => \T_FUNCTION, @@ -227,7 +227,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::incrementDecrementOperators()} method for access. * - * @var array => + * @var array */ private static $incrementDecrementOperators = [ \T_DEC => \T_DEC, @@ -247,7 +247,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::listOpenTokensBC()} method for access. * - * @var array => + * @var array */ private static $listOpenTokensBC = [ \T_LIST => \T_LIST, @@ -264,7 +264,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::listTokens()} method for access. * - * @var array => + * @var array */ private static $listTokens = [ \T_LIST => \T_LIST, @@ -277,7 +277,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::namespaceDeclarationClosers()} method for access. * - * @var array => + * @var array */ private static $namespaceDeclarationClosers = [ \T_SEMICOLON => \T_SEMICOLON, @@ -298,7 +298,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::nameTokens()} method for access. * - * @var array => + * @var array */ private static $nameTokens = [ \T_STRING => \T_STRING, @@ -312,7 +312,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::objectOperators()} method for access. * - * @var array => + * @var array */ private static $objectOperators = [ \T_DOUBLE_COLON => \T_DOUBLE_COLON, @@ -325,7 +325,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::ooCanExtend()} method for access. * - * @var array => + * @var array */ private static $ooCanExtend = [ \T_CLASS => \T_CLASS, @@ -338,7 +338,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::ooCanImplement()} method for access. * - * @var array => + * @var array */ private static $ooCanImplement = [ \T_CLASS => \T_CLASS, @@ -353,7 +353,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::ooConstantScopes()} method for access. * - * @var array => + * @var array */ private static $ooConstantScopes = [ \T_CLASS => \T_CLASS, @@ -370,7 +370,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::ooHierarchyKeywords()} method for access. * - * @var array => + * @var array */ private static $ooHierarchyKeywords = [ \T_PARENT => \T_PARENT, @@ -385,7 +385,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::ooPropertyScopes()} method for access. * - * @var array => + * @var array */ private static $ooPropertyScopes = [ \T_CLASS => \T_CLASS, @@ -398,7 +398,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::parameterTypeTokens()} method for access. * - * @var array => + * @var array */ private static $parameterTypeTokens = [ \T_CALLABLE => \T_CALLABLE, @@ -416,7 +416,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::phpOpenTags()} method for access. * - * @var array => + * @var array */ private static $phpOpenTags = [ \T_OPEN_TAG => \T_OPEN_TAG, @@ -428,7 +428,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::propertyModifierKeywords()} method for access. * - * @var array => + * @var array */ private static $propertyModifierKeywords = [ \T_PUBLIC => \T_PUBLIC, @@ -444,7 +444,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::propertyTypeTokens()} method for access. * - * @var array => + * @var array */ private static $propertyTypeTokens = [ \T_CALLABLE => \T_CALLABLE, @@ -462,7 +462,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::returnTypeTokens()} method for access. * - * @var array => + * @var array */ private static $returnTypeTokens = [ \T_CALLABLE => \T_CALLABLE, @@ -481,7 +481,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::shortArrayListOpenTokensBC()} method for access. * - * @var array => + * @var array */ private static $shortArrayListOpenTokensBC = [ \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, @@ -494,7 +494,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::shortArrayTokens()} method for access. * - * @var array => + * @var array */ private static $shortArrayTokens = [ \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, @@ -508,7 +508,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::shortListTokens()} method for access. * - * @var array => + * @var array */ private static $shortListTokens = [ \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, @@ -520,7 +520,7 @@ final class Collections * * @since 1.0.0 Use the {@see Collections::textStringStartTokens()} method for access. * - * @var array => + * @var array */ private static $textStringStartTokens = [ \T_START_HEREDOC => \T_START_HEREDOC, @@ -534,11 +534,11 @@ final class Collections * * @since 1.0.0 * - * @param string $name The name of the method which has been called. - * @param array $args Any arguments passed to the method. - * Unused as none of the methods take arguments. + * @param string $name The name of the method which has been called. + * @param array $args Any arguments passed to the method. + * Unused as none of the methods take arguments. * - * @return array => Token array + * @return array Token array * * @throws \PHPCSUtils\Exceptions\InvalidTokenArray When an invalid token array is requested. */ @@ -592,17 +592,11 @@ private static function triggerDeprecation($method, $version, $replacement) * * @since 1.0.0 * - * @return array => + * @return array */ public static function arrayOpenTokensBC() { - $tokens = self::$arrayOpenTokensBC; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - - return $tokens; + return self::$arrayOpenTokensBC; } /** @@ -619,18 +613,11 @@ public static function arrayOpenTokensBC() * * @since 1.0.0 * - * @return array => + * @return array */ public static function arrayTokensBC() { - $tokens = self::$arrayTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$arrayTokens; } /** @@ -640,7 +627,7 @@ public static function arrayTokensBC() * * @since 1.0.0 * - * @return array => + * @return array */ public static function functionCallTokens() { @@ -669,17 +656,11 @@ public static function functionCallTokens() * * @since 1.0.0 * - * @return array => + * @return array */ public static function listOpenTokensBC() { - $tokens = self::$listOpenTokensBC; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - - return $tokens; + return self::$listOpenTokensBC; } /** @@ -694,18 +675,11 @@ public static function listOpenTokensBC() * * @since 1.0.0 * - * @return array => + * @return array */ public static function listTokensBC() { - $tokens = self::$listTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$listTokens; } /** @@ -718,7 +692,7 @@ public static function listTokensBC() * * @since 1.0.0 * - * @return array => + * @return array */ public static function namespacedNameTokens() { @@ -739,7 +713,7 @@ public static function namespacedNameTokens() * * @since 1.0.0 * - * @return array => + * @return array */ public static function parameterPassingTokens() { @@ -761,7 +735,7 @@ public static function parameterPassingTokens() * * @since 1.0.0 * - * @return array => + * @return array */ public static function parameterTypeTokens() { @@ -776,7 +750,7 @@ public static function parameterTypeTokens() * * @since 1.0.0 * - * @return array => + * @return array */ public static function propertyTypeTokens() { @@ -791,7 +765,7 @@ public static function propertyTypeTokens() * * @since 1.0.0 * - * @return array => + * @return array */ public static function returnTypeTokens() { @@ -811,17 +785,11 @@ public static function returnTypeTokens() * * @since 1.0.0 * - * @return array => + * @return array */ public static function shortArrayListOpenTokensBC() { - $tokens = self::$shortArrayListOpenTokensBC; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - - return $tokens; + return self::$shortArrayListOpenTokensBC; } /** @@ -836,18 +804,11 @@ public static function shortArrayListOpenTokensBC() * * @since 1.0.0 * - * @return array => + * @return array */ public static function shortArrayTokensBC() { - $tokens = self::$shortArrayTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$shortArrayTokens; } /** @@ -862,17 +823,10 @@ public static function shortArrayTokensBC() * * @since 1.0.0 * - * @return array => + * @return array */ public static function shortListTokensBC() { - $tokens = self::$shortListTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$shortListTokens; } } diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php index 3fe7a100..1e228413 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php @@ -29,7 +29,7 @@ final class Arrays * * @since 1.0.0 * - * @var array => + * @var array */ private static $doubleArrowTargets = [ \T_DOUBLE_ARROW => \T_DOUBLE_ARROW, @@ -86,15 +86,15 @@ public static function isShortArray(File $phpcsFile, $stackPtr) * tokens in an array. * Use with care. * - * @return array|false An array with the token pointers; or `FALSE` if this is not a - * (short) array token or if the opener/closer could not be determined. - * The format of the array return value is: - * ```php - * array( - * 'opener' => integer, // Stack pointer to the array open bracket. - * 'closer' => integer, // Stack pointer to the array close bracket. - * ) - * ``` + * @return array|false An array with the token pointers; or `FALSE` if this is not a + * (short) array token or if the opener/closer could not be determined. + * The format of the array return value is: + * ```php + * array( + * 'opener' => integer, // Stack pointer to the array open bracket. + * 'closer' => integer, // Stack pointer to the array close bracket. + * ) + * ``` */ public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortArray = null) { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php index aba769e3..76f0e885 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php @@ -39,12 +39,12 @@ final class Conditions * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $types Optional. The type(s) of tokens to search for. - * @param bool $first Optional. Whether to search for the first (outermost) - * (`true`) or the last (innermost) condition (`false`) of - * the specified type(s). + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $types Optional. The type(s) of tokens to search for. + * @param bool $first Optional. Whether to search for the first (outermost) + * (`true`) or the last (innermost) condition (`false`) of + * the specified type(s). * * @return int|false Integer stack pointer to the condition; or `FALSE` if the token * does not have the condition or has no conditions at all. @@ -103,9 +103,9 @@ public static function getCondition(File $phpcsFile, $stackPtr, $types = [], $fi * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $types The type(s) of tokens to search for. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $types The type(s) of tokens to search for. * * @return bool */ @@ -122,9 +122,9 @@ public static function hasCondition(File $phpcsFile, $stackPtr, $types) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $types Optional. The type(s) of tokens to search for. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $types Optional. The type(s) of tokens to search for. * * @return int|false Integer stack pointer to the condition; or `FALSE` if the token * does not have the condition or has no conditions at all. @@ -142,9 +142,9 @@ public static function getFirstCondition(File $phpcsFile, $stackPtr, $types = [] * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $types Optional. The type(s) of tokens to search for. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $types Optional. The type(s) of tokens to search for. * * @return int|false Integer stack pointer to the condition; or `FALSE` if the token * does not have the condition or has no conditions at all. diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php index 44bc053d..b343c736 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php @@ -199,7 +199,8 @@ public static function isElseIf(File $phpcsFile, $stackPtr) * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. * @param int $stackPtr The position of the token we are checking. * - * @return array Array with information about the caught Exception(s). + * @return array> + * Array with information about the caught Exception(s). * The returned array will contain the following information for * each caught exception: * ```php diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php index 153bce45..e24bcf27 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php @@ -43,7 +43,7 @@ final class FunctionDeclarations * * @since 1.0.0 * - * @var array => + * @var array */ public static $magicFunctions = [ '__autoload' => 'autoload', @@ -59,7 +59,7 @@ final class FunctionDeclarations * * @since 1.0.0 * - * @var array => + * @var array */ public static $magicMethods = [ '__construct' => 'construct', @@ -94,7 +94,7 @@ final class FunctionDeclarations * * @since 1.0.0 * - * @var array => + * @var array */ public static $methodsDoubleUnderscore = [ '__dorequest' => 'SOAPClient', @@ -148,7 +148,6 @@ public static function getName(File $phpcsFile, $stackPtr) * - Defensive coding against incorrect calls to this method. * - More efficient checking whether a function has a body. * - Support for PHP 8.0 identifier name tokens in return types, cross-version PHP & PHPCS. - * - Support for the PHP 8.2 `true` type. * - The results of this function call are cached during a PHPCS run for faster response times. * * @see \PHP_CodeSniffer\Files\File::getMethodProperties() Original source. @@ -160,7 +159,7 @@ public static function getName(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the stack of the function token to * acquire the properties for. * - * @return array Array with information about a function declaration. + * @return array Array with information about a function declaration. * The format of the return value is: * ```php * array( @@ -248,12 +247,6 @@ public static function getProperties(File $phpcsFile, $stackPtr) $hasBody = false; $returnTypeTokens = Collections::returnTypeTokens(); - /* - * BC PHPCS < 3.x.x: The union type separator is not (yet) retokenized correctly - * for union types containing the `true` type. - */ - $returnTypeTokens[\T_BITWISE_OR] = \T_BITWISE_OR; - $parenthesisCloser = null; if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { $parenthesisCloser = $tokens[$stackPtr]['parenthesis_closer']; @@ -367,7 +360,6 @@ public static function getProperties(File $phpcsFile, $stackPtr) * - More efficient and more stable looping of the default value. * - Clearer exception message when a non-closure use token was passed to the function. * - Support for PHP 8.0 identifier name tokens in parameter types, cross-version PHP & PHPCS. - * - Support for the PHP 8.2 `true` type. * - The results of this function call are cached during a PHPCS run for faster response times. * * @see \PHP_CodeSniffer\Files\File::getMethodParameters() Original source. @@ -379,7 +371,7 @@ public static function getProperties(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the stack of the function token * to acquire the parameters for. * - * @return array + * @return array> * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of * type `T_FUNCTION`, `T_CLOSURE` or `T_USE`, @@ -447,12 +439,6 @@ public static function getParameters(File $phpcsFile, $stackPtr) $parameterTypeTokens = Collections::parameterTypeTokens(); - /* - * BC PHPCS < 3.x.x: The union type separator is not (yet) retokenized correctly - * for union types containing the `true` type. - */ - $parameterTypeTokens[\T_BITWISE_OR] = \T_BITWISE_OR; - for ($i = $paramStart; $i <= $closer; $i++) { if (isset($parameterTypeTokens[$tokens[$i]['code']]) === true /* diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php index baf2c02a..167d6508 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php @@ -33,7 +33,7 @@ final class Lists * * @since 1.0.0 * - * @var array + * @var array */ private static $listItemDefaults = [ 'raw' => '', @@ -87,15 +87,15 @@ public static function isShortList(File $phpcsFile, $stackPtr) * tokens in a list. * Use with care. * - * @return array|false An array with the token pointers; or `FALSE` if this is not a (short) list - * token or if the opener/closer could not be determined. - * The format of the array return value is: - * ```php - * array( - * 'opener' => integer, // Stack pointer to the list open bracket. - * 'closer' => integer, // Stack pointer to the list close bracket. - * ) - * ``` + * @return array|false An array with the token pointers; or `FALSE` if this is not a (short) list + * token or if the opener/closer could not be determined. + * The format of the array return value is: + * ```php + * array( + * 'opener' => integer, // Stack pointer to the list open bracket. + * 'closer' => integer, // Stack pointer to the list close bracket. + * ) + * ``` */ public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortList = null) { @@ -190,7 +190,8 @@ public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortList = n * @param int $stackPtr The position in the stack of the function token * to acquire the parameters for. * - * @return array An array with information on each assignment made, including skipped assignments (empty), + * @return array> + * An array with information on each assignment made, including skipped assignments (empty), * or an empty array if no assignments are made at all (fatal error in PHP >= 7.0). * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php index 388f2a09..eb7c1505 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php @@ -34,7 +34,7 @@ final class MessageHelper * Defaults to true (error). * @param string $code The error code for the message. * Defaults to 'Found'. - * @param array $data Optional input for the data replacements. + * @param scalar[] $data Optional input for the data replacements. * @param int $severity Optional. Severity level. Defaults to 0 which will * translate to the PHPCS default severity level. * @@ -70,7 +70,7 @@ public static function addMessage( * Defaults to true (error). * @param string $code The error code for the message. * Defaults to 'Found'. - * @param array $data Optional input for the data replacements. + * @param scalar[] $data Optional input for the data replacements. * @param int $severity Optional. Severity level. Defaults to 0 which will * translate to the PHPCS default severity level. * diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php index 053643d7..69ec4ef0 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php @@ -106,7 +106,7 @@ final class Numbers * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. * @param int $stackPtr The position of a T_LNUMBER or T_DNUMBER token. * - * @return array An array with information about the number. + * @return array An array with information about the number. * The format of the array return value is: * ```php * array( diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php index e284224c..cb45bd4f 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php @@ -147,7 +147,7 @@ public static function getName(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the stack of the `T_CLASS` * token to acquire the properties for. * - * @return array Array with implementation properties of a class. + * @return array Array with implementation properties of a class. * The format of the return value is: * ```php * array( @@ -272,8 +272,8 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr) * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. * @param int $stackPtr The stack position of the class or enum token. * - * @return array|false Array with names of the implemented interfaces or `FALSE` on - * error or if there are no implemented interface names. + * @return string[]|false Array with names of the implemented interfaces or `FALSE` on + * error or if there are no implemented interface names. */ public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) { @@ -290,8 +290,8 @@ public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. * @param int $stackPtr The stack position of the interface keyword. * - * @return array|false Array with names of the extended interfaces or `FALSE` on - * error or if there are no extended interface names. + * @return string[]|false Array with names of the extended interfaces or `FALSE` on + * error or if there are no extended interface names. */ public static function findExtendedInterfaceNames(File $phpcsFile, $stackPtr) { @@ -309,16 +309,16 @@ public static function findExtendedInterfaceNames(File $phpcsFile, $stackPtr) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The stack position of the - * class/interface declaration keyword. - * @param int $keyword The token constant for the keyword to examine. - * Either `T_EXTENDS` or `T_IMPLEMENTS`. - * @param array $allowedFor Array of OO types for which use of the keyword - * is allowed. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The stack position of the + * class/interface declaration keyword. + * @param int $keyword The token constant for the keyword to examine. + * Either `T_EXTENDS` or `T_IMPLEMENTS`. + * @param array $allowedFor Array of OO types for which use of the keyword + * is allowed. * - * @return array|false Returns an array of names or `FALSE` on error or when the object - * being declared does not extend/implement another object. + * @return string[]|false Returns an array of names or `FALSE` on error or when the object + * being declared does not extend/implement another object. */ private static function findNames(File $phpcsFile, $stackPtr, $keyword, array $allowedFor) { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php index ae155c13..562440fe 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php @@ -35,7 +35,7 @@ final class Operators * * @since 1.0.0 * - * @var array => + * @var array Note: value is irrelevant, only key is used. */ private static $extraUnaryIndicators = [ \T_STRING_CONCAT => true, diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php index 2e7384e0..998b64f9 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php @@ -34,7 +34,7 @@ final class Parentheses * * @since 1.0.0 * - * @var array => + * @var array */ private static $extraParenthesesOwners = [ \T_ISSET => \T_ISSET, @@ -95,10 +95,10 @@ public static function getOwner(File $phpcsFile, $stackPtr) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of `T_OPEN/CLOSE_PARENTHESIS` token. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of `T_OPEN/CLOSE_PARENTHESIS` token. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return bool `TRUE` if the owner is within the list of `$validOwners`; `FALSE` if not and * if the parenthesis does not have a (direct) owner. @@ -121,10 +121,10 @@ public static function isOwnerIn(File $phpcsFile, $stackPtr, $validOwners) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return bool */ @@ -143,10 +143,10 @@ public static function hasOwner(File $phpcsFile, $stackPtr, $validOwners) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the parentheses opener; or `FALSE` if the token * does not have parentheses owned by any of the valid owners or if @@ -167,10 +167,10 @@ public static function getFirstOpener(File $phpcsFile, $stackPtr, $validOwners = * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the parentheses closer; or `FALSE` if the token * does not have parentheses owned by any of the valid owners or if @@ -197,10 +197,10 @@ public static function getFirstCloser(File $phpcsFile, $stackPtr, $validOwners = * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the parentheses owner; or `FALSE` if the token * does not have parentheses owned by any of the valid owners or if @@ -226,10 +226,10 @@ public static function getFirstOwner(File $phpcsFile, $stackPtr, $validOwners = * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the parentheses opener; or `FALSE` if the token * does not have parentheses owned by any of the valid owners or if @@ -250,10 +250,10 @@ public static function getLastOpener(File $phpcsFile, $stackPtr, $validOwners = * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the parentheses closer; or `FALSE` if the token * does not have parentheses owned by any of the valid owners or if @@ -280,10 +280,10 @@ public static function getLastCloser(File $phpcsFile, $stackPtr, $validOwners = * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the parentheses owner; or `FALSE` if the token * does not have parentheses owned by any of the valid owners or if @@ -305,11 +305,11 @@ public static function getLastOwner(File $phpcsFile, $stackPtr, $validOwners = [ * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack of the - * token to verify. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack of the + * token to verify. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the valid parentheses owner; or `FALSE` if * the token was not wrapped in parentheses or if the outermost set @@ -333,11 +333,11 @@ public static function firstOwnerIn(File $phpcsFile, $stackPtr, $validOwners) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack of the - * token to verify. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack of the + * token to verify. + * @param int|string|array $validOwners Array of token constants for the owners + * which should be considered valid. * * @return int|false Integer stack pointer to the valid parentheses owner; or `FALSE` if * the token was not wrapped in parentheses or if the innermost set @@ -363,13 +363,13 @@ public static function lastOwnerIn(File $phpcsFile, $stackPtr, $validOwners) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $validOwners Optional. Array of token constants for the owners - * which should be considered valid. - * @param bool $reverse Optional. Whether to search for the first/outermost - * (`false`) or the last/innermost (`true`) set of - * parentheses with the specified owner(s). + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $validOwners Optional. Array of token constants for the owners + * which should be considered valid. + * @param bool $reverse Optional. Whether to search for the first/outermost + * (`false`) or the last/innermost (`true`) set of + * parentheses with the specified owner(s). * * @return int|false Integer stack pointer to the parentheses opener; or `FALSE` if the token * does not have parentheses owned by any of the valid owners or if diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php index f73ee8c4..35f1f391 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php @@ -33,7 +33,7 @@ final class PassedParameters * * @since 1.0.0 * - * @var array => + * @var array */ private static $callParsingStopPoints = [ \T_COMMA => \T_COMMA, @@ -170,7 +170,8 @@ public static function hasParameters(File $phpcsFile, $stackPtr, $isShortArray = * Efficiency tweak for when this has already been established, * Use with EXTREME care. * - * @return array A multi-dimentional array with information on each parameter/array item. + * @return array> + * A multi-dimentional array with information on each parameter/array item. * The information gathered about each parameter/array item is in the following format: * ```php * 1 => array( @@ -379,11 +380,11 @@ public static function getParameters(File $phpcsFile, $stackPtr, $limit = 0, $is * always pass both the offset as well as the parameter * name when examining function calls. * - * @return array|false Array with information on the parameter/array item at the specified offset, - * or with the specified name. - * Or `FALSE` if the specified parameter/array item is not found. - * See {@see PassedParameters::getParameters()} for the format of the returned - * (single-dimensional) array. + * @return array|false Array with information on the parameter/array item at the specified + * offset, or with the specified name. + * Or `FALSE` if the specified parameter/array item is not found. + * See {@see PassedParameters::getParameters()} for the format of the + * returned (single-dimensional) array. * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the token passed is not one of the * accepted types or doesn't exist. @@ -452,20 +453,23 @@ public static function getParameterCount(File $phpcsFile, $stackPtr) * * @since 1.0.0 * - * @param array $parameters The output of a previous call to {@see PassedParameters::getParameters()}. - * @param int $paramOffset The 1-based index position of the parameter to retrieve. - * @param string|string[] $paramNames Either the name of the target parameter to retrieve - * as a string or an array of names for the same target parameter. - * An array of names is supported to allow for functions - * for which the parameter names have undergone name - * changes over time. - * The name will take precedence over the offset. + * @param array> $parameters The output of a previous call to + * {@see PassedParameters::getParameters()}. + * @param int $paramOffset The 1-based index position of the parameter + * to retrieve. + * @param string|string[] $paramNames Either the name of the target parameter to retrieve + * as a string or an array of names for the same target + * parameter. + * An array of names is supported to allow for functions + * for which the parameter names have undergone name + * changes over time. + * The name will take precedence over the offset. * - * @return array|false Array with information on the parameter at the specified offset, - * or with the specified name. - * Or `FALSE` if the specified parameter is not found. - * See {@see PassedParameters::getParameters()} for the format of the returned - * (single-dimensional) array. + * @return array|false Array with information on the parameter at the specified offset, + * or with the specified name. + * Or `FALSE` if the specified parameter is not found. + * See {@see PassedParameters::getParameters()} for the format of the + * returned (single-dimensional) array. * * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the `$paramNames` parameter is not passed * and the requested parameter was not passed diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php index 32947c9e..99011fba 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php @@ -30,11 +30,11 @@ final class Scopes * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack of the - * token to verify. - * @param int|string|array $validScopes Array of token constants representing - * the scopes considered valid. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack of the + * token to verify. + * @param int|string|array $validScopes Array of token constants representing + * the scopes considered valid. * * @return int|false Integer stack pointer to the valid direct scope; or `FALSE` if * no valid direct scope was found. diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php index 4e917322..3fdf9d66 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php @@ -156,7 +156,8 @@ public static function isTraitUse(File $phpcsFile, $stackPtr) * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. * @param int $stackPtr The position in the stack of the `T_USE` token. * - * @return array A multi-level array containing information about the use statement. + * @return array> + * A multi-level array containing information about the use statement. * The first level is `'name'`, `'function'` and `'const'`. These keys will always exist. * If any statements are found for any of these categories, the second level * will contain the alias/name as the key and the full original use name as the @@ -358,16 +359,18 @@ public static function splitImportUseStatement(File $phpcsFile, $stackPtr) * * @since 1.0.0 * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack of the `T_USE` token. - * @param array $previousUseStatements The import `use` statements collected so far. - * This should be either the output of a - * previous call to this method or the output of - * an earlier call to the - * {@see UseStatements::splitImportUseStatement()} - * method. - * - * @return array A multi-level array containing information about the current `use` statement combined with + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack of the + * `T_USE` token. + * @param array> $previousUseStatements The import `use` statements collected so far. + * This should be either the output of a + * previous call to this method or the output of + * an earlier call to the + * {@see UseStatements::splitImportUseStatement()} + * method. + * + * @return array> + * A multi-level array containing information about the current `use` statement combined with * the previously collected `use` statement information. * See {@see UseStatements::splitImportUseStatement()} for more details about the array format. */ @@ -393,19 +396,20 @@ public static function splitAndMergeImportUseStatement(File $phpcsFile, $stackPt * * @since 1.0.0 * - * @param array $previousUseStatements The import `use` statements collected so far. - * This should be either the output of a - * previous call to this method or the output of - * an earlier call to the - * {@see UseStatements::splitImportUseStatement()} - * method. - * @param array $currentUseStatement The parsed import `use` statements to merge with - * the previously collected use statements. - * This should be the output of a call to the - * {@see UseStatements::splitImportUseStatement()} - * method. - * - * @return array A multi-level array containing information about the current `use` statement combined with + * @param array> $previousUseStatements The import `use` statements collected so far. + * This should be either the output of a + * previous call to this method or the output of + * an earlier call to the + * {@see UseStatements::splitImportUseStatement()} + * method. + * @param array> $currentUseStatement The parsed import `use` statements to merge with + * the previously collected use statements. + * This should be the output of a call to the + * {@see UseStatements::splitImportUseStatement()} + * method. + * + * @return array> + * A multi-level array containing information about the current `use` statement combined with * the previously collected `use` statement information. * See {@see UseStatements::splitImportUseStatement()} for more details about the array format. */ diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php index 4c92e1ed..a97135f4 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php @@ -41,7 +41,7 @@ final class Variables * * @since 1.0.0 * - * @var array => + * @var array */ public static $phpReservedVars = [ '_SERVER' => true, @@ -82,7 +82,6 @@ final class Variables * other non-property variables passed to the method. * - Defensive coding against incorrect calls to this method. * - Support PHP 8.0 identifier name tokens in property types, cross-version PHP & PHPCS. - * - Support for the PHP 8.2 `true` type. * - The results of this function call are cached during a PHPCS run for faster response times. * * @see \PHP_CodeSniffer\Files\File::getMemberProperties() Original source. @@ -94,7 +93,7 @@ final class Variables * @param int $stackPtr The position in the stack of the `T_VARIABLE` token * to acquire the properties for. * - * @return array Array with information about the class member variable. + * @return array Array with information about the class member variable. * The format of the return value is: * ```php * array( @@ -183,12 +182,6 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr) $nullableType = false; $propertyTypeTokens = Collections::propertyTypeTokens(); - /* - * BC PHPCS < 3.x.x: The union type separator is not (yet) retokenized correctly - * for union types containing the `true` type. - */ - $propertyTypeTokens[\T_BITWISE_OR] = \T_BITWISE_OR; - if ($i < $stackPtr) { // We've found a type. for ($i; $i < $stackPtr; $i++) { diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml index f4365516..eefc6dbb 100644 --- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml +++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml @@ -1,4 +1,4 @@ - + Utility methods for external PHPCS standards. diff --git a/vendor/phpcsstandards/phpcsutils/README.md b/vendor/phpcsstandards/phpcsutils/README.md index 20d2b200..430855ea 100644 --- a/vendor/phpcsstandards/phpcsutils/README.md +++ b/vendor/phpcsstandards/phpcsutils/README.md @@ -8,13 +8,14 @@ [![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcsstandards/phpcsutils#dev-develop) [![Last Commit to Unstable](https://img.shields.io/github/last-commit/PHPCSStandards/PHPCSUtils/develop.svg)](https://github.com/PHPCSStandards/PHPCSUtils/commits/develop) -[![Minimum PHP Version](https://img.shields.io/packagist/php-v/phpcsstandards/phpcsutils.svg?maxAge=3600)][phpcsutils-packagist] +[![Docs website](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/update-docs.yml/badge.svg)][phpcsutils-web] [![CS Build Status](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/basics.yml/badge.svg?branch=develop)](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/basics.yml) [![Test Build Status](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/test.yml/badge.svg?branch=develop)][phpcsutils-tests-gha] -[![Tested on PHP 5.4 to 8.2](https://img.shields.io/badge/tested%20on-PHP%205.4%20|%205.5%20|%205.6%20|%207.0%20|%207.1%20|%207.2%20|%207.3%20|%207.4%20|%208.0%20|%208.1%20|%208.2-brightgreen.svg?maxAge=2419200)][phpcsutils-tests-gha] [![Coverage Status](https://coveralls.io/repos/github/PHPCSStandards/PHPCSUtils/badge.svg?branch=develop)](https://coveralls.io/github/PHPCSStandards/PHPCSUtils?branch=develop) -[![Docs website](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/update-docs.yml/badge.svg)][phpcsutils-web] +[![Minimum PHP Version](https://img.shields.io/packagist/php-v/phpcsstandards/phpcsutils.svg?maxAge=3600)][phpcsutils-packagist] +[![Tested on PHP 5.4 to 8.3](https://img.shields.io/badge/tested%20on-PHP%205.4%20|%205.5%20|%205.6%20|%207.0%20|%207.1%20|%207.2%20|%207.3%20|%207.4%20|%208.0%20|%208.1%20|%208.2%20|%208.3-brightgreen.svg?maxAge=2419200)][phpcsutils-tests-gha] + [![License: LGPLv3](https://poser.pugx.org/phpcsstandards/phpcsutils/license)](https://github.com/PHPCSStandards/PHPCSUtils/blob/stable/LICENSE) ![Awesome](https://img.shields.io/badge/awesome%3F-yes!-brightgreen.svg) @@ -45,7 +46,7 @@ Whether you need to split an `array` into the individual items, are trying to de Includes improved versions of the PHPCS native utility functions and plenty of new utility functions. -These functions are compatible with PHPCS 3.7.1 up to PHPCS `master`. +These functions are compatible with PHPCS 3.8.0 up to PHPCS `master`. ### A collection of static properties and methods for often-used token groups @@ -65,7 +66,7 @@ Supports PHPUnit 4.x up to 9.x. Normally to use the latest version of PHP_CodeSniffer native utility functions, you would have to raise the minimum requirements of your external PHPCS standard. -Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 3.7.1 and up. +Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 3.8.0 and up. ### Fully documented @@ -77,7 +78,7 @@ To see detailed information about all the available abstract sniffs, utility fun ## Minimum Requirements * PHP 5.4 or higher. -* [PHP_CodeSniffer] 3.7.1+. +* [PHP_CodeSniffer] 3.8.0+. * Recommended PHP extensions for optimal functionality: - PCRE with Unicode support (normally enabled by default) @@ -127,7 +128,7 @@ To use a non-Composer based installation for your sniff development environment, Your installation instructions for a non-Composer based installation will probably look similar to this: -> * Install [PHP_CodeSniffer] via [your preferred method](https://github.com/squizlabs/PHP_CodeSniffer#installation). +> * Install [PHP_CodeSniffer] via [your preferred method](https://github.com/PHPCSStandards/PHP_CodeSniffer#installation). > * Register the path to PHPCS in your system `$PATH` environment variable to make the `phpcs` command available from anywhere in your file system. > * Download the \[latest _YourStandardName_ release\] and unzip/untar it into an arbitrary directory. > You can also choose to clone the repository using git. @@ -164,11 +165,11 @@ For things to continue working when you add PHPCSUtils to your standard, you nee To support non-Composer based installs for running your sniff unit tests, you will need to adjust the PHPUnit `bootstrap.php` file to allow for passing an environment variable pointing to your PHPCSUtils installation.
- Example bootstrap code using a PHPCSUTILS_DIR environment variable + Example bootstrap code using a PHPCSUtils_DIR environment variable ```php // Get the PHPCS dir from an environment variable. -$phpcsUtilDir = getenv('PHPCSUTILS_DIR'); +$phpcsUtilDir = getenv('PHPCSUtils_DIR'); // This may be a Composer install. if ($phpcsUtilDir === false && file_exists(__DIR__ . '/vendor/autoload.php')) { @@ -191,7 +192,7 @@ if ($phpcsUtilDir === false && file_exists(__DIR__ . '/vendor/autoload.php')) { echo 'Uh oh... can\'t find PHPCSUtils. If you use Composer, please run `composer install`. -Otherwise, make sure you set a `PHPCSUTILS_DIR` environment variable in your phpunit.xml file +Otherwise, make sure you set a `PHPCSUtils_DIR` environment variable in your phpunit.xml file pointing to the PHPCS directory. '; @@ -208,7 +209,7 @@ Once that's done, you will need to make a small tweak to your own dev environmen ```xml - + ``` @@ -287,7 +288,7 @@ If you are unsure whether the changes you are proposing would be welcome, please This code is released under the [GNU Lesser General Public License (LGPLv3)](LICENSE). -[PHP_CodeSniffer]: https://github.com/squizlabs/PHP_CodeSniffer +[PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer [Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer [phpcsutils-repo]: https://github.com/PHPCSStandards/PHPCSUtils [phpcsutils-web]: https://phpcsutils.com/ diff --git a/vendor/phpcsstandards/phpcsutils/composer.json b/vendor/phpcsstandards/phpcsutils/composer.json index 8c0e8d45..bd5c4ae0 100644 --- a/vendor/phpcsstandards/phpcsutils/composer.json +++ b/vendor/phpcsstandards/phpcsutils/composer.json @@ -19,11 +19,12 @@ "support" : { "issues" : "https://github.com/PHPCSStandards/PHPCSUtils/issues", "source" : "https://github.com/PHPCSStandards/PHPCSUtils", - "docs" : "https://phpcsutils.com/" + "docs" : "https://phpcsutils.com/", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy" }, "require" : { "php" : ">=5.4", - "squizlabs/php_codesniffer" : "^3.7.1 || 4.0.x-dev@dev", + "squizlabs/php_codesniffer" : "^3.8.0 || 4.0.x-dev@dev", "dealerdirect/phpcodesniffer-composer-installer" : "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0" }, "require-dev" : { @@ -31,7 +32,7 @@ "phpcsstandards/phpcsdevcs": "^1.1.6", "php-parallel-lint/php-parallel-lint": "^1.3.2", "php-parallel-lint/php-console-highlighter": "^1.0", - "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/vendor/squizlabs/php_codesniffer/CHANGELOG.md b/vendor/squizlabs/php_codesniffer/CHANGELOG.md new file mode 100644 index 00000000..450dbd4a --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/CHANGELOG.md @@ -0,0 +1,5432 @@ +# Changelog +The file documents changes to the PHP_CodeSniffer project. + +## [Unreleased] + +_Nothing yet._ + + +## [3.8.0] - 2023-12-08 + +[Squizlabs/PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) is dead. Long live [PHPCSStandards/PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer)! + +### Breaking Changes +- The `squizlabs/PHP_CodeSniffer` repository has been abandoned. The `PHPCSStandards/PHP_CodeSniffer` repository will serve as the continuation of the project. For more information about this change, please read the [announcement](https://github.com/squizlabs/PHP_CodeSniffer/issues/3932). + - Installation of PHP_CodeSniffer via PEAR is no longer supported. + - Users will need to switch to another installation method. + - Note: this does not affect the PEAR sniffs. + - For Composer users, nothing changes. + - **_In contrast to earlier information, the `squizlabs/php_codesniffer` package now points to the new repository and everything will continue to work as before._** + - PHIVE users may need to clear the PHIVE URL cache. + - PHIVE users who don't use the package alias, but refer to the package URL, will need to update the URL from `https://squizlabs.github.io/PHP_CodeSniffer/phars/` to `https://phars.phpcodesniffer.com/phars/`. + - Users who download the PHAR files using curl or wget, will need to update the download URL from `https://squizlabs.github.io/PHP_CodeSniffer/[phpcs|phpcbf].phar` or `https://github.com/squizlabs/PHP_CodeSnifffer/releases/latest/download/[phpcs|phpcbf].phar` to `https://phars.phpcodesniffer.com/[phpcs|phpcbf].phar`. + - For users who install PHP_CodeSniffer via the [setup-php](https://github.com/shivammathur/setup-php/) action runner for GitHub Actions, nothing changes. + - Users using a git clone will need to update the clone address from `git@github.com:squizlabs/PHP_CodeSniffer.git` to `git@github.com:PHPCSStandards/PHP_CodeSniffer.git`. + - Contributors will need to fork the new repo and add both the new fork as well as the new repo as remotes to their local git copy of PHP_CodeSniffer. + - Users who have (valid) open issues or pull requests in the `squizlabs/PHP_CodeSniffer` repository are invited to resubmit these to the `PHPCSStandards/PHP_CodeSniffer` repository. + +### Added +- Runtime support for PHP 8.3. All known PHP 8.3 deprecation notices have been fixed + - Syntax support for new PHP 8.3 features will follow in a future release + - If you find any PHP 8.3 deprecation notices which were missed, please report them + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patches +- Added support for PHP 8.2 readonly classes to File::getClassProperties() through a new is_readonly array index in the return value + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Added support for PHP 8.2 readonly classes to a number of sniffs + - Generic.CodeAnalysis.UnnecessaryFinalModifier + - PEAR.Commenting.ClassComment + - PEAR.Commenting.FileComment + - PSR1.Files.SideEffects + - PSR2.Classes.ClassDeclaration + - PSR12.Files.FileHeader + - Squiz.Classes.ClassDeclaration + - Squiz.Classes.LowercaseClassKeywords + - Squiz.Commenting.ClassComment + - Squiz.Commenting.DocCommentAlignment + - Squiz.Commenting.FileComment + - Squiz.Commenting.InlineComment + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Added support for PHP 8.2 `true` as a stand-alone type declaration + - The `File::getMethodProperties()`, `File::getMethodParameters()` and `File::getMemberProperties()` methods now all support the `true` type + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Added support for PHP 8.2 `true` as a stand-alone type to a number of sniffs + - Generic.PHP.LowerCaseType + - PSr12.Functions.NullableTypeDeclaration + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Added a Performance report to allow for finding "slow" sniffs + - To run this report, run PHPCS with --report=Performance. + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Generic.PHP.RequireStrictTypes : new warning for when there is a declare statement, but the strict_types directive is set to 0 + - The warning can be turned off by excluding the `Generic.PHP.RequireStrictTypes.Disabled` error code + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Squiz.Commenting.FunctionComment : new `ParamNameUnexpectedAmpersandPrefix` error for parameters annotated as passed by reference while the parameter is not passed by reference + - Thanks to Dan Wallis (@fredden) for the patch +- Documentation has been added for the following sniffs: + - PSR2.Files.ClosingTag + - PSR2.Methods.FunctionCallSignature + - PSR2.Methods.FunctionClosingBrace + - Thanks to Atsushi Okui (@blue32a) for the patch +- Support for PHPUnit 8 and 9 to the test suite + - Test suites for external standards which run via the PHPCS native test suite can now run on PHPUnit 4-9 (was 4-7) + - If any of these tests use the PHPUnit `setUp()`/`tearDown()` methods or overload the `setUp()` in the `AbstractSniffUnitTest` test case, they will need to be adjusted. See the [PR details for further information](https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/59/commits/26384ebfcc0b1c1651b0e1e40c9b6c8c22881832) + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch + +### Changed +- Changes have been made to the way PHPCS handles invalid sniff properties being set in a custom ruleset + - Fixes PHP 8.2 deprecation notices for properties set in a (custom) ruleset for complete standards/complete sniff categories + - Invalid sniff properties set for individual sniffs will now result in an error and halt the execution of PHPCS + - A descriptive error message is provided to allow users to fix their ruleset + - Sniff properties set for complete standards/complete sniff categories will now only be set on sniffs which explicitly support the property + - The property will be silently ignored for those sniffs which do not support the property + - Invalid sniff properties set for sniffs via inline annotations will result in an informative `Internal.PropertyDoesNotExist` errror on line 1 of the scanned file, but will not halt the execution of PHPCS + - For sniff developers, it is strongly recommended for sniffs to explicitly declare any user-adjustable public properties + - If dynamic properties need to be supported for a sniff, either declare the magic __set()/__get()/__isset()/__unset() methods on the sniff or let the sniff extend stdClass + - Note: The #[\AllowDynamicProperties] attribute will have no effect for properties which are being set in rulesets + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- The third parameter for the Ruleset::setSniffProperty() method has been changed to expect an array + - Sniff developers/integrators of PHPCS may need to make some small adjustments to allow for this change + - Existing code will continue to work but will throw a deprecation error + - The backwards compatiblity layer will be removed in PHPCS 4.0 + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- When using `auto` report width (the default) a value of 80 columns will be used if the width cannot be determined + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Sniff error messages are now more informative to help bugs get reported to the correct project + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Generic.CodeAnalysis.UnusedFunctionParameter will now ignore magic methods for which the signature is defined by PHP + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Generic.Functions.OpeningFunctionBraceBsdAllman will now check the brace indent before the opening brace for empty functions + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Generic.Functions.OpeningFunctionBraceKernighanRitchie will now check the spacing before the opening brace for empty functions + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Generic.WhiteSpace.IncrementDecrementSpacing now detects more spacing issues + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- PSR2.Classes.PropertyDeclaration now enforces that the readonly modifier comes after the visibility modifier + - PSR2 and PSR12 do not have documented rules for this as they pre-date the readonly modifier + - PSR-PER has been used to confirm the order of this keyword so it can be applied to PSR2 and PSR12 correctly + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- PEAR.Commenting.FunctionComment + Squiz.Commenting.FunctionComment: the SpacingAfter error can now be auto-fixed + - Thanks to Dan Wallis (@fredden) for the patch +- Squiz.PHP.InnerFunctions sniff no longer reports on OO methods for OO structures declared within a function or closure + - Thanks to @Daimona for the patch +- Squiz.PHP.NonExecutableCode will now also flag redundant return statements just before a closure close brace + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Runtime performance improvement for PHPCS CLI users. The improvement should be most noticeable for users on Windows. + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- The following sniffs have received performance related improvements: + - Generic.PHP.LowerCaseConstant + - Generic.PHP.LowerCaseType + - PSR12.Files.OpenTag + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patches +- The -e (explain) command will now list sniffs in natural order + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Tests using the PHPCS native test framework with multiple test case files will now run the test case files in numeric order. + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- The following sniffs have received minor message readability improvements: + - Generic.Arrays.ArrayIndent + - Generic.Formatting.SpaceAfterCast + - Generic.Formatting.SpaceAfterNot + - Generic.WhiteSpace.SpreadOperatorSpacingAfter + - Squiz.Arrays.ArrayDeclaration + - Squiz.Commenting.DocCommentAlignment + - Squiz.ControlStructures.ControlSignature + - Thanks to Danny van der Sluijs (@DannyvdSluijs) and Juliette Reinders Folmer (@jrfnl) for the patches +- Improved README syntax highlighting + - Thanks to Benjamin Loison (@Benjamin-Loison) for the patch +- Various documentation improvements + - Thanks to Andrew Dawes (@AndrewDawes), Danny van der Sluijs (@DannyvdSluijs) and Juliette Reinders Folmer (@jrfnl) for the patches + +### Removed +- Removed support for installation via PEAR + - Use composer or the PHAR files instead + +### Fixed +- Fixed bug [#2857] : Squiz/NonExecutableCode: prevent false positives when exit is used in a ternary expression or as default with null coalesce + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3386] : PSR1/SideEffects : improved recognition of disable/enable annotations + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3557] : Squiz.Arrays.ArrayDeclaration will now ignore PHP 7.4 array unpacking when determining whether an array is associative + - Thanks to Volker Dusch (@edorian) for the patch +- Fixed bug [#3592] : Squiz/NonExecutableCode: prevent false positives when a PHP 8.0+ inline throw expression is encountered + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3715] : Generic/UnusedFunctionParameter: fixed incorrect errorcode for closures/arrow functions nested within extended classes/classes which implement + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3717] : Squiz.Commenting.FunctionComment: fixed false positive for `InvalidNoReturn` when type is never + - Thanks to Choraimy Kroonstuiver (@axlon) for the patch +- Fixed bug [#3720] : Generic/RequireStrictTypes : will now bow out silently in case of parse errors/live coding instead of throwing false positives/false negatives + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3720] : Generic/RequireStrictTypes : did not handle multi-directive declare statements + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3722] : Potential "Uninitialized string offset 1" in octal notation backfill + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3736] : PEAR/FunctionDeclaration: prevent fixer removing the close brace (and creating a parse error) when there is no space between the open brace and close brace of a function + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3739] : PEAR/FunctionDeclaration: prevent fixer conflict, and potentially creating a parse error, for unconventionally formatted return types + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3770] : Squiz/NonExecutableCode: prevent false positives for switching between PHP and HTML + - Thanks to Dan Wallis (@fredden) for the patch +- Fixed bug [#3773] : Tokenizer/PHP: tokenization of the readonly keyword when used in combination with PHP 8.2 disjunctive normal types + - Thanks to Dan Wallis (@fredden) and Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3776] : Generic/JSHint: error when JSHint is not available + - Thanks to Dan Wallis (@fredden) for the patch +- Fixed bug [#3777] : Squiz/NonExecutableCode: slew of bug fixes, mostly related to modern PHP + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3778] : Squiz/LowercasePHPFunctions: bug fix for class names in attributes + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3779] : Generic/ForbiddenFunctions: bug fix for class names in attributes + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3785] : Squiz.Commenting.FunctionComment: potential "Uninitialized string offset 0" when a type contains a duplicate pipe symbol + - Thanks to Dan Wallis (@fredden) for the patch +- Fixed bug [#3787] : PEAR/Squiz/[MultiLine]FunctionDeclaration: allow for PHP 8.1 new in initializers + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3789] : Incorrect tokenization for ternary operator with `match` inside of it + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3790] : PSR12/AnonClassDeclaration: prevent fixer creating parse error when there was no space before the open brace + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3797] : Tokenizer/PHP: more context sensitive keyword fixes + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3801] : File::getMethodParameters(): allow for readonly promoted properties without visibility + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3805] : Generic/FunctionCallArgumentSpacing: prevent fixer conflict over PHP 7.3+ trailing comma's in function calls + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3806] : Squiz.PHP.InnerFunctions sniff now correctly reports inner functions declared within a closure + - Thanks to @Daimona for the patch +- Fixed bug [#3809] : GitBlame report was broken when passing a basepath + - Thanks to Chris (@datengraben) for the patch +- Fixed bug [#3813] : Squiz.Commenting.FunctionComment: false positive for parameter name mismatch on parameters annotated as passed by reference + - Thanks to Dan Wallis (@fredden) for the patch +- Fixed bug [#3833] : Generic.PHP.LowerCaseType: fixed potential undefined array index notice + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3846] : PSR2.Classes.ClassDeclaration.CloseBraceAfterBody : fixer will no longer remove indentation on the close brace line + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3854] : Fatal error when using Gitblame report in combination with `--basepath` and running from project subdirectory + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3856] : PSR12.Traits.UseDeclaration was using the wrong error code - SpacingAfterAs - for spacing issues after the `use` keyword + - These will now be reported using the SpacingAfterUse error code + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3856] : PSR12.Traits.UseDeclaration did not check spacing after `use` keyword for multi-line trait use statements + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3867] : Tokenizer/PHP: union type and intersection type operators were not correctly tokenized for static properties without explicit visibility + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3877] : Filter names can be case-sensitive. The -h help text will now display the correct case for the available filters + - Thanks to @simonsan for the patch +- Fixed bug [#3893] : Generic/DocComment : the SpacingAfterTagGroup fixer could accidentally remove ignore annotations + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3898] : Squiz/NonExecutableCode : the sniff could get confused over comments in unexpected places + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3904] : Squiz/FunctionSpacing : prevent potential fixer conflict + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug [#3906] : Tokenizer/CSS: bug fix related to the unsupported slash comment syntax + - Thanks to Dan Wallis (@fredden) for the patch +- Fixed bug [#3913] : Config did not always correctly store unknown "long" arguments in the `$unknown` property + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch + +Thanks go to Dan Wallis (@fredden) and Danny van der Sluijs (@DannyvdSluijs) for reviewing quite a few of the PRs for this release. +Additionally, thanks to Alexander Turek (@derrabus) for consulting on the repo change over. + +[#2857]: https://github.com/squizlabs/PHP_CodeSniffer/issues/2857 +[#3386]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3386 +[#3557]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3557 +[#3592]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3592 +[#3715]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3715 +[#3717]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3717 +[#3720]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3720 +[#3722]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3722 +[#3736]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3736 +[#3739]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3739 +[#3770]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3770 +[#3773]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3773 +[#3776]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3776 +[#3777]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3777 +[#3778]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3778 +[#3779]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3779 +[#3785]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3785 +[#3787]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3787 +[#3789]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3789 +[#3790]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3790 +[#3797]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3797 +[#3801]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3801 +[#3805]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3805 +[#3806]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3806 +[#3809]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3809 +[#3813]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3813 +[#3833]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3833 +[#3846]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3846 +[#3854]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3854 +[#3856]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3856 +[#3867]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3867 +[#3877]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3877 +[#3893]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3893 +[#3898]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3898 +[#3904]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3904 +[#3906]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3906 +[#3913]: https://github.com/squizlabs/PHP_CodeSniffer/pull/3913 + +## [3.7.2] - 2023-02-23 +### Changed +- Newer versions of Composer will now suggest installing PHPCS using require-dev instead of require + - Thanks to Gary Jones (@GaryJones) for the patch +- A custom Out Of Memory error will now be shown if PHPCS or PHPCBF run out of memory during a run + - Error message provides actionable information about how to fix the problem and ensures the error is not silent + - Thanks to Juliette Reinders Folmer (@jrfnl) and Alain Schlesser (@schlessera) for the patch +- Generic.PHP.LowerCaseType sniff now correctly examines types inside arrow functions + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Squiz.Formatting.OperatorBracket no longer reports false positives in match() structures + +### Fixed +- Fixed bug #3616 : Squiz.PHP.DisallowComparisonAssignment false positive for PHP 8 match expression + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug #3618 : Generic.WhiteSpace.ArbitraryParenthesesSpacing false positive for return new parent() + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug #3632 : Short list not tokenized correctly in control structures without braces + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug #3639 : Tokenizer not applying tab replacement to heredoc/nowdoc closers + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug #3640 : Generic.WhiteSpace.DisallowTabIndent not reporting errors for PHP 7.3 flexible heredoc/nowdoc syntax + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug #3645 : PHPCS can show 0 exit code when running in parallel even if child process has fatal error + - Thanks to Alex Panshin (@enl) for the patch +- Fixed bug #3653 : False positives for match() in OperatorSpacingSniff + - Thanks to Jaroslav Hanslík (@kukulich) for the patch +- Fixed bug #3666 : PEAR.Functions.FunctionCallSignature incorrect indent fix when checking mixed HTML/PHP files +- Fixed bug #3668 : PSR12.Classes.ClassInstantiation.MissingParentheses false positive when instantiating parent classes + - Similar issues also fixed in Generic.Functions.FunctionCallArgumentSpacing and Squiz.Formatting.OperatorBracket + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch +- Fixed bug #3672 : Incorrect ScopeIndent.IncorrectExact report for match inside array literal +- Fixed bug #3694 : Generic.WhiteSpace.SpreadOperatorSpacingAfter does not ignore spread operator in PHP 8.1 first class callables + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch + +## [3.7.1] - 2022-06-18 +### Fixed +- Fixed bug #3609 : Methods/constants with name empty/isset/unset are always reported as error + - Thanks to Juliette Reinders Folmer (@jrfnl) for the patch + +## [3.7.0] - 2022-06-13 +### Added +- Added support for PHP 8.1 explicit octal notation + - This new syntax has been backfilled for PHP versions less than 8.1 + - Thanks to Mark Baker for the patch + - Thanks to Juliette Reinders Folmer for additional fixes +- Added support for PHP 8.1 enums + - This new syntax has been backfilled for PHP versions less than 8.1 + - Includes a new T_ENUM_CASE token to represent the case statements inside an enum + - Thanks to Jaroslav Hanslík for the patch + - Thanks to Juliette Reinders Folmer for additional core and sniff support +- Added support for the PHP 8.1 readonly token + - Tokenzing of the readonly keyword has been backfilled for PHP versions less than 8.1 + - Thanks to Jaroslav Hanslík for the patch +- Added support for PHP 8.1 intersection types + - Includes a new T_TYPE_INTERSECTION token to represent the ampersand character inside intersection types + - Thanks to Jaroslav Hanslík for the patch + +### Changed +- File::getMethodParameters now supports the new PHP 8.1 readonly token + - When constructor property promotion is used, a new property_readonly array index is included in the return value + - This is a boolean value indicating if the property is readonly + - If the readonly token is detected, a new readonly_token array index is included in the return value + - This contains the token index of the readonly keyword + - Thanks to Juliette Reinders Folmer for the patch +- Support for new PHP 8.1 readonly keyword has been added to the following sniffs: + - Generic.PHP.LowerCaseKeyword + - PSR2.Classes.PropertyDeclaration + - Squiz.Commenting.BlockComment + - Squiz.Commenting.DocCommentAlignment + - Squiz.Commenting.VariableComment + - Squiz.WhiteSpace.ScopeKeywordSpacing + - Thanks to Juliette Reinders Folmer for the patches +- The parallel feature is now more efficient and runs faster in some situations due to improved process management + - Thanks to Sergei Morozov for the patch +- The list of installed coding standards now has consistent ordering across all platforms + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHP.UpperCaseConstant and Generic.PHP.LowerCaseConstant now ignore type declarations + - These sniffs now only report errors for true/false/null when used as values + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHP.LowerCaseType now supports the PHP 8.1 never type + - Thanks to Jaroslav Hanslík for the patch + +### Fixed +- Fixed bug #3502 : A match statement within an array produces Squiz.Arrays.ArrayDeclaration.NoKeySpecified +- Fixed bug #3503 : Squiz.Commenting.FunctionComment.ThrowsNoFullStop false positive when one line @throw +- Fixed bug #3505 : The nullsafe operator is not counted in Generic.Metrics.CyclomaticComplexity + - Thanks to Mark Baker for the patch +- Fixed bug #3526 : PSR12.Properties.ConstantVisibility false positive when using public final const syntax + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3530 : Line indented incorrectly false positive when using match-expression inside switch case +- Fixed bug #3534 : Name of typed enum tokenized as T_GOTO_LABEL + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3546 : Tokenizer/PHP: bug fix - parent/static keywords in class instantiations + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3550 : False positive from PSR2.ControlStructures.SwitchDeclaration.TerminatingComment when using trailing comment + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3575: Squiz.Scope.MethodScope misses visibility keyword on previous line + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3604: Tokenizer/PHP: bug fix for double quoted strings using ${ + - Thanks to Juliette Reinders Folmer for the patch + +## [3.6.2] - 2021-12-13 +### Changed +- Processing large code bases that use tab indenting inside comments and strings will now be faster + - Thanks to Thiemo Kreuz for the patch + +### Fixed +- Fixed bug #3388 : phpcs does not work when run from WSL drives + - Thanks to Juliette Reinders Folmer and Graham Wharton for the patch +- Fixed bug #3422 : Squiz.WhiteSpace.ScopeClosingBrace fixer removes HTML content when fixing closing brace alignment + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3437 : PSR12 does not forbid blank lines at the start of the class body + - Added new PSR12.Classes.OpeningBraceSpace sniff to enforce this +- Fixed bug #3440 : Squiz.WhiteSpace.MemberVarSpacing false positives when attributes used without docblock + - Thanks to Vadim Borodavko for the patch +- Fixed bug #3448 : PHP 8.1 deprecation notice while generating running time value + - Thanks to Juliette Reinders Folmer and Andy Postnikov for the patch +- Fixed bug #3456 : PSR12.Classes.ClassInstantiation.MissingParentheses false positive using attributes on anonymous class + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3460 : Generic.Formatting.MultipleStatementAlignment false positive on closure with parameters + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3468 : do/while loops are double-counted in Generic.Metrics.CyclomaticComplexity + - Thanks to Mark Baker for the patch +- Fixed bug #3469 : Ternary Operator and Null Coalescing Operator are not counted in Generic.Metrics.CyclomaticComplexity + - Thanks to Mark Baker for the patch +- Fixed bug #3472 : PHP 8 match() expression is not counted in Generic.Metrics.CyclomaticComplexity + - Thanks to Mark Baker for the patch + +## [3.6.1] - 2021-10-11 +### Changed +- PHPCS annotations can now be specified using hash-style comments + - Previously, only slash-style and block-style comments could be used to do things like disable errors + - Thanks to Juliette Reinders Folmer for the patch +- The new PHP 8.1 tokenisation for ampersands has been reverted to use the existing PHP_CodeSniffer method + - The PHP 8.1 tokens T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG and T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG are unsued + - Ampersands continue to be tokenized as T_BITWISE_AND for all PHP versions + - Thanks to Juliette Reinders Folmer and Anna Filina for the patch +- File::getMethodParameters() no longer incorrectly returns argument attributes in the type hint array index + - A new has_attributes array index is available and set to TRUE if the argument has attributes defined + - Thanks to Juliette Reinders Folmer for the patch +- Fixed an issue where some sniffs would not run on PHP files that only used the short echo tag + - The following sniffs were affected: + - Generic.Files.ExecutableFile + - Generic.Files.LowercasedFilename + - Generic.Files.LineEndings + - Generic.Files.EndFileNewline + - Generic.Files.EndFileNoNewline + - Generic.PHP.ClosingPHPTag + - Generic.PHP.Syntax + - Generic.VersionControl.GitMergeConflict + - Generic.WhiteSpace.DisallowSpaceIndent + - Generic.WhiteSpace.DisallowTabIndent + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.BlockComment now correctly applies rules for block comments after a short echo tag + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Generic.NamingConventions.ConstructorName no longer throws deprecation notices on PHP 8.1 + - Thanks to Juliette Reinders Folmer for the patch +- Fixed false positives when using attributes in the following sniffs: + - PEAR.Commenting.FunctionComment + - Squiz.Commenting.InlineComment + - Squiz.Commenting.BlockComment + - Squiz.Commenting.VariableComment + - Squiz.WhiteSpace.MemberVarSpacing + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3294 : Bug in attribute tokenization when content contains PHP end token or attribute closer on new line + - Thanks to Alessandro Chitolina for the patch + - Thanks to Juliette Reinders Folmer for the tests +- Fixed bug #3296 : PSR2.ControlStructures.SwitchDeclaration takes phpcs:ignore as content of case body +- Fixed bug #3297 : PSR2.ControlStructures.SwitchDeclaration.TerminatingComment does not handle try/finally blocks + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3302 : PHP 8.0 | Tokenizer/PHP: bugfix for union types using namespace operator + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3303 : findStartOfStatement() doesn't work with T_OPEN_TAG_WITH_ECHO +- Fixed bug #3316 : Arrow function not tokenized correctly when using null in union type +- Fixed bug #3317 : Problem with how phpcs handles ignored files when running in parallel + - Thanks to Emil Andersson for the patch +- Fixed bug #3324 : PHPCS hangs processing some nested arrow functions inside a function call +- Fixed bug #3326 : Generic.Formatting.MultipleStatementAlignment error with const DEFAULT + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3333 : Squiz.Objects.ObjectInstantiation: null coalesce operators are not recognized as assignment + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3340 : Ensure interface and trait names are always tokenized as T_STRING + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3342 : PSR12/Squiz/PEAR standards all error on promoted properties with docblocks + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3345 : IF statement with no braces and double catch turned into syntax error by auto-fixer + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3352 : PSR2.ControlStructures.SwitchDeclaration can remove comments on the same line as the case statement while fixing + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3357 : Generic.Functions.OpeningFunctionBraceBsdAllman removes return type when additional lines are present + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3362 : Generic.WhiteSpace.ScopeIndent false positive for arrow functions inside arrays +- Fixed bug #3384 : Squiz.Commenting.FileComment.SpacingAfterComment false positive on empty file +- Fixed bug #3394 : Fix PHP 8.1 auto_detect_line_endings deprecation notice +- Fixed bug #3400 : PHP 8.1: prevent deprecation notices about missing return types + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3424 : PHPCS fails when using PHP 8 Constructor property promotion with attributes + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3425 : PHP 8.1 | Runner::processChildProcs(): fix passing null to non-nullable bug + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3445 : Nullable parameter after attribute incorrectly tokenized as ternary operator + - Thanks to Juliette Reinders Folmer for the patch + +## [3.6.0] - 2021-04-09 +### Added +- Added support for PHP 8.0 union types + - A new T_TYPE_UNION token is available to represent the pipe character + - File::getMethodParameters(), getMethodProperties(), and getMemberProperties() will now return union types + - Thanks to Juliette Reinders Folmer for the patch +- Added support for PHP 8.0 named function call arguments + - A new T_PARAM_NAME token is available to represent the label with the name of the function argument in it + - Thanks to Juliette Reinders Folmer for the patch +- Added support for PHP 8.0 attributes + - The PHP-supplied T_ATTRIBUTE token marks the start of an attribute + - A new T_ATTRIBUTE_END token is available to mark the end of an attribute + - New attribute_owner and attribute_closer indexes are available in the tokens array for all tokens inside an attribute + - Tokenizing of attributes has been backfilled for older PHP versions + - The following sniffs have been updated to support attributes: + - PEAR.Commenting.ClassComment + - PEAR.Commenting.FileComment + - PSR1.Files.SideEffects + - PSR12.Files.FileHeader + - Squiz.Commenting.ClassComment + - Squiz.Commenting.FileComment + - Squiz.WhiteSpace.FunctionSpacing + - Thanks to Vadim Borodavko for the patch + - Thanks to Alessandro Chitolina for the patch +- Added support for PHP 8.0 dereferencing of text strings with interpolated variables + - Thanks to Juliette Reinders Folmer for the patch +- Added support for PHP 8.0 match expressions + - Match expressions are now tokenised with parenthesis and scope openers and closers + - Sniffs can listen for the T_MATCH token to process match expressions + - Note that the case and default statements inside match expressions do not have scopes set + - A new T_MATCH_ARROW token is available to represent the arrows in match expressions + - A new T_MATCH_DEFAULT token is available to represent the default keyword in match expressions + - All tokenizing of match expressions has been backfilled for older PHP versions + - The following sniffs have been updated to support match expressions: + - Generic.CodeAnalysis.AssignmentInCondition + - Generic.CodeAnalysis.EmptyPHPStatement + - Thanks to Vadim Borodavko for the patch + - Generic.CodeAnalysis.EmptyStatement + - Generic.PHP.LowerCaseKeyword + - PEAR.ControlStructures.ControlSignature + - PSR12.ControlStructures.BooleanOperatorPlacement + - Squiz.Commenting.LongConditionClosingComment + - Squiz.Commenting.PostStatementComment + - Squiz.ControlStructures.LowercaseDeclaration + - Squiz.ControlStructures.ControlSignature + - Squiz.Formatting.OperatorBracket + - Squiz.PHP.DisallowMultipleAssignments + - Squiz.Objects.ObjectInstantiation + - Squiz.WhiteSpace.ControlStructureSpacing + - Thanks to Juliette Reinders Folmer for the patch +- Added Generic.NamingConventions.AbstractClassNamePrefix to enforce that class names are prefixed with "Abstract" + - Thanks to Anna Borzenko for the contribution +- Added Generic.NamingConventions.InterfaceNameSuffix to enforce that interface names are suffixed with "Interface" + - Thanks to Anna Borzenko for the contribution +- Added Generic.NamingConventions.TraitNameSuffix to enforce that trait names are suffixed with "Trait" + - Thanks to Anna Borzenko for the contribution + +### Changed +- The value of the T_FN_ARROW token has changed from "T_FN_ARROW" to "PHPCS_T_FN_ARROW" to avoid package conflicts + - This will have no impact on custom sniffs unless they are specifically looking at the value of the T_FN_ARROW constant + - If sniffs are just using constant to find arrow functions, they will continue to work without modification + - Thanks to Juliette Reinders Folmer for the patch +- File::findStartOfStatement() now works correctly when passed the last token in a statement +- File::getMethodParameters() now supports PHP 8.0 constructor property promotion + - Returned method params now include a "property_visibility" and "visibility_token" index if property promotion is detected + - Thanks to Juliette Reinders Folmer for the patch +- File::getMethodProperties() now includes a "return_type_end_token" index in the return value + - This indicates the last token in the return type, which is helpful when checking union types + - Thanks to Juliette Reinders Folmer for the patch +- Include patterns are now ignored when processing STDIN + - Previously, checks using include patterns were excluded when processing STDIN when no file path was provided via --stdin-path + - Now, all include and exclude rules are ignored when no file path is provided, allowing all checks to run + - If you want include and exclude rules enforced when checking STDIN, use --stdin-path to set the file path + - Thanks to Juliette Reinders Folmer for the patch +- Spaces are now correctly escaped in the paths to external on Windows + - Thanks to Juliette Reinders Folmer for the patch +- Generic.CodeAnalysis.UnusedFunctionParameter can now be configured to ignore variable usage for specific type hints + -- This allows you to suppress warnings for some variables that are not required, but leave warnings for others + -- Set the ignoreTypeHints array property to a list of type hints to ignore + -- Thanks to Petr Bugyík for the patch +- Generic.Formatting.MultipleStatementAlignment can now align statements at the start of the assignment token + - Previously, the sniff enforced that the values were aligned, even if this meant the assignment tokens were not + - Now, the sniff can enforce that the assignment tokens are aligned, even if this means the values are not + - Set the "alignAtEnd" sniff property to "false" to align the assignment tokens + - The default remains at "true", so the assigned values are aligned + - Thanks to John P. Bloch for the patch +- Generic.PHP.LowerCaseType now supports checking of typed properties + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHP.LowerCaseType now supports checking of union types + - Thanks to Juliette Reinders Folmer for the patch +- PEAR.Commenting.FunctionComment and Squiz.Commenting.FunctionComment sniffs can now ignore private and protected methods + - Set the "minimumVisibility" sniff property to "protected" to ignore private methods + - Set the "minimumVisibility" sniff property to "public" to ignore both private and protected methods + - The default remains at "private", so all methods are checked + - Thanks to Vincent Langlet for the patch +- PEAR.Commenting.FunctionComment and Squiz.Commenting.FunctionComment sniffs can now ignore return tags in any method + - Previously, only __construct and __destruct were ignored + - Set the list of method names to ignore in the "specialMethods" sniff property + - The default remains at "__construct" and "__destruct" only + - Thanks to Vincent Langlet for the patch +- PSR2.ControlStructures.SwitchDeclaration now supports nested switch statements where every branch terminates + - Previously, if a CASE only contained a SWITCH and no direct terminating statement, a fall-through error was displayed + - Now, the error is surpressed if every branch of the SWITCH has a terminating statement + - Thanks to Vincent Langlet for the patch +- The PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket error message is now reported on the closing parenthesis token + - Previously, the error was being reported on the function keyword, leading to confusing line numbers in the error report +- Squiz.Commenting.FunctionComment is now able to ignore function comments that are only inheritdoc statements + - Set the skipIfInheritdoc sniff property to "true" to skip checking function comments if the content is only {@inhertidoc} + - The default remains at "false", so these comments will continue to report errors + - Thanks to Jess Myrbo for the patch +- Squiz.Commenting.FunctionComment now supports the PHP 8 mixed type + - Thanks to Vadim Borodavko for the patch +- Squiz.PHP.NonExecutableCode now has improved handling of syntax errors + - Thanks to Thiemo Kreuz for the patch +- Squiz.WhiteSpace.ScopeKeywordSpacing now checks spacing when using PHP 8.0 constructor property promotion + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed an issue that could occurr when checking files on network drives, such as with WSL2 on Windows 10 + - This works around a long-standing PHP bug with is_readable() + - Thanks to Michael S for the patch +- Fixed a number of false positives in the Squiz.PHP.DisallowMultipleAssignments sniff + - Sniff no longer errors for default value assignments in arrow functions + - Sniff no longer errors for assignments on first line of closure + - Sniff no longer errors for assignments after a goto label + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #2913 : Generic.WhiteSpace.ScopeIndent false positive when opening and closing tag on same line inside conditional +- Fixed bug #2992 : Enabling caching using a ruleset produces invalid cache files when using --sniffs and --exclude CLI args +- Fixed bug #3003 : Squiz.Formatting.OperatorBracket autofix incorrect when assignment used with null coalescing operator +- Fixed bug #3145 : Autoloading of sniff fails when multiple classes declared in same file +- Fixed bug #3157 : PSR2.ControlStructures.SwitchDeclaration.BreakIndent false positive when case keyword is not indented +- Fixed bug #3163 : Undefined index error with pre-commit hook using husky on PHP 7.4 + - Thanks to Ismo Vuorinen for the patch +- Fixed bug #3165 : Squiz.PHP.DisallowComparisonAssignment false positive when comparison inside closure +- Fixed bug #3167 : Generic.WhiteSpace.ScopeIndent false positive when using PHP 8.0 constructor property promotion +- Fixed bug #3170 : Squiz.WhiteSpace.OperatorSpacing false positive when using negation with string concat + - This also fixes the same issue in the PSR12.Operators.OperatorSpacing sniff +- Fixed bug #3177 : Incorrect tokenization of GOTO statements in mixed PHP/HTML files + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3184 : PSR2.Namespace.NamespaceDeclaration false positive on namespace operator + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3188 : Squiz.WhiteSpace.ScopeKeywordSpacing false positive for static return type + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3192 : findStartOfStatement doesn't work correctly inside switch + - Thanks to Vincent Langlet for the patch +- Fixed bug #3195 : Generic.WhiteSpace.ScopeIndent confusing message when combination of tabs and spaces found +- Fixed bug #3197 : Squiz.NamingConventions.ValidVariableName does not use correct error code for all member vars +- Fixed bug #3219 : Generic.Formatting.MultipleStatementAlignment false positive for empty anonymous classes and closures +- Fixed bug #3258 : Squiz.Formatting.OperatorBracket duplicate error messages for unary minus + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3273 : Squiz.Functions.FunctionDeclarationArgumentSpacing reports line break as 0 spaces between parenthesis +- Fixed bug #3277 : Nullable static return typehint causes whitespace error +- Fixed bug #3284 : Unused parameter false positive when using array index in arrow function + +## [3.5.8] - 2020-10-23 +### Removed +- Reverted a change to the way include/exclude patterns are processed for STDIN content + - This change is not backwards compatible and will be re-introduced in version 3.6.0 + +## [3.5.7] - 2020-10-23 +### Added +- The PHP 8.0 T_NULLSAFE_OBJECT_OPERATOR token has been made available for older versions + - Existing sniffs that check for T_OBJECT_OPERATOR have been modified to apply the same rules for the nullsafe object operator + - Thanks to Juliette Reinders Folmer for the patch +- The new method of PHP 8.0 tokenizing for namespaced names has been revert to thr pre 8.0 method + - This maintains backwards compatible for existing sniffs on PHP 8.0 + - This change will be removed in PHPCS 4.0 as the PHP 8.0 tokenizing method will be backported for pre 8.0 versions + - Thanks to Juliette Reinders Folmer for the patch +- Added support for changes to the way PHP 8.0 tokenizes hash comments + - The existing PHP 5-7 behaviour has been replicated for version 8, so no sniff changes are required + - Thanks to Juliette Reinders Folmer for the patch +- Running the unit tests now includes warnings in the found and fixable error code counts + - Thanks to Juliette Reinders Folmer for the patch +- PSR12.Functions.NullableTypeDeclaration now supports the PHP8 static return type + - Thanks to Juliette Reinders Folmer for the patch + +### Changed +- The autoloader has been changed to fix sniff class name detection issues that may occur when running on PHP 7.4+ + - Thanks to Eloy Lafuente for the patch +- PSR12.ControlStructures.BooleanOperatorPlacement.FoundMixed error message is now more accurate when using the allowOnly setting + - Thanks to Vincent Langlet for the patch + +### Fixed +- Fixed Squiz.Formatting.OperatorBracket false positive when exiting with a negative number +- Fixed Squiz.PHP.DisallowComparisonAssignment false positive for methods called on an object +- Fixed bug #2882 : Generic.Arrays.ArrayIndent can request close brace indent to be less than the statement indent level +- Fixed bug #2883 : Generic.WhiteSpace.ScopeIndent.Incorrect issue after NOWDOC +- Fixed bug #2975 : Undefined offset in PSR12.Functions.ReturnTypeDeclaration when checking function return type inside ternary +- Fixed bug #2988 : Undefined offset in Squiz.Strings.ConcatenationSpacing during live coding + - Thanks to Thiemo Kreuz for the patch +- Fixed bug #2989 : Incorrect auto-fixing in Generic.ControlStructures.InlineControlStructure during live coding + - Thanks to Thiemo Kreuz for the patch +- Fixed bug #3007 : Directory exclude pattern improperly excludes directories with names that start the same + - Thanks to Steve Talbot for the patch +- Fixed bug #3043 : Squiz.WhiteSpace.OperatorSpacing false positive for negation in arrow function + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3049 : Incorrect error with arrow function and parameter passed as reference + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3053 : PSR2 incorrect fix when multiple use statements on same line do not have whitespace between them +- Fixed bug #3058 : Progress gets unaligned when 100% happens at the end of the available dots +- Fixed bug #3059 : Squiz.Arrays.ArrayDeclaration false positive when using type casting + - Thanks to Sergei Morozov for the patch +- Fixed bug #3060 : Squiz.Arrays.ArrayDeclaration false positive for static functions + - Thanks to Sergei Morozov for the patch +- Fixed bug #3065 : Should not fix Squiz.Arrays.ArrayDeclaration.SpaceBeforeComma if comment between element and comma + - Thanks to Sergei Morozov for the patch +- Fixed bug #3066 : No support for namespace operator used in type declarations + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3075 : PSR12.ControlStructures.BooleanOperatorPlacement false positive when operator is the only content on line +- Fixed bug #3099 : Squiz.WhiteSpace.OperatorSpacing false positive when exiting with negative number + - Thanks to Sergei Morozov for the patch +- Fixed bug #3102 : PSR12.Squiz.OperatorSpacing false positive for default values of arrow functions + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #3124 : PSR-12 not reporting error for empty lines with only whitespace +- Fixed bug #3135 : Ignore annotations are broken on PHP 8.0 + - Thanks to Juliette Reinders Folmer for the patch + +## [3.5.6] - 2020-08-10 +### Added +- Added support for PHP 8.0 magic constant dereferencing + - Thanks to Juliette Reinders Folmer for the patch +- Added support for changes to the way PHP 8.0 tokenizes comments + - The existing PHP 5-7 behaviour has been replicated for version 8, so no sniff changes are required + - Thanks to Juliette Reinders Folmer for the patch +- `File::getMethodProperties()` now detects the PHP 8.0 static return type + - Thanks to Juliette Reinders Folmer for the patch +- The PHP 8.0 static return type is now supported for arrow functions + - Thanks to Juliette Reinders Folmer for the patch + +### Changed +- The cache is no longer used if the list of loaded PHP extensions changes + - Thanks to Juliette Reinders Folmer for the patch +- `Generic.NamingConventions.CamelCapsFunctionName` no longer reports `__serialize` and `__unserialize` as invalid names + - Thanks to Filip Š for the patch +- `PEAR.NamingConventions.ValidFunctionName` no longer reports `__serialize` and `__unserialize` as invalid names + - Thanks to Filip Š for the patch +- `Squiz.Scope.StaticThisUsage` now detects usage of `$this` inside closures and arrow functions + - Thanks to Michał Bundyra for the patch + +### Fixed +- Fixed bug #2877 : PEAR.Functions.FunctionCallSignature false positive for array of functions + - Thanks to Vincent Langlet for the patch +- Fixed bug #2888 : PSR12.Files.FileHeader blank line error with multiple namespaces in one file +- Fixed bug #2926 : phpcs hangs when using arrow functions that return heredoc +- Fixed bug #2943 : Redundant semicolon added to a file when fixing PSR2.Files.ClosingTag.NotAllowed +- Fixed bug #2967 : Markdown generator does not output headings correctly + - Thanks to Petr Bugyík for the patch +- Fixed bug #2977 : File::isReference() does not detect return by reference for closures + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2994 : Generic.Formatting.DisallowMultipleStatements false positive for FOR loop with no body +- Fixed bug #3033 : Error generated during tokenizing of goto statements on PHP 8 + - Thanks to Juliette Reinders Folmer for the patch + +## [3.5.5] - 2020-04-17 +### Changed +- The T_FN backfill now works more reliably so T_FN tokens only ever represent real arrow functions + - Thanks to Juliette Reinders Folmer for the patch +- Fixed an issue where including sniffs using paths containing multiple dots would silently fail +- Generic.CodeAnalysis.EmptyPHPStatement now detects empty statements at the start of control structures + +### Fixed +- Error wording in PEAR.Functions.FunctionCallSignature now always uses "parenthesis" instead of sometimes using "bracket" + - Thanks to Vincent Langlet for the patch +- Fixed bug #2787 : Squiz.PHP.DisallowMultipleAssignments not ignoring typed property declarations + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2810 : PHPCBF fails to fix file with empty statement at start on control structure +- Fixed bug #2812 : Squiz.Arrays.ArrayDeclaration not detecting some arrays with multiple arguments on the same line + - Thanks to Jakub Chábek for the patch +- Fixed bug #2826 : Generic.WhiteSpace.ArbitraryParenthesesSpacing doesn't detect issues for statements directly after a control structure + - Thanks to Vincent Langlet for the patch +- Fixed bug #2848 : PSR12.Files.FileHeader false positive for file with mixed PHP and HTML and no file header +- Fixed bug #2849 : Generic.WhiteSpace.ScopeIndent false positive with arrow function inside array +- Fixed bug #2850 : Generic.PHP.LowerCaseKeyword complains __HALT_COMPILER is uppercase +- Fixed bug #2853 : Undefined variable error when using Info report + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2865 : Double arrow tokenized as T_STRING when placed after function named "fn" +- Fixed bug #2867 : Incorrect scope matching when arrow function used inside IF condition +- Fixed bug #2868 : phpcs:ignore annotation doesnt work inside a docblock +- Fixed bug #2878 : PSR12.Files.FileHeader conflicts with Generic.Files.LineEndings +- Fixed bug #2895 : PSR2.Methods.FunctionCallSignature.MultipleArguments false positive with arrow function argument + +## [3.5.4] - 2020-01-31 +### Changed +- The PHP 7.4 numeric separator backfill now works correctly for more float formats + - Thanks to Juliette Reinders Folmer for the patch +- The PHP 7.4 numeric separator backfill is no longer run on PHP version 7.4.0 or greater +- File::getCondition() now accepts a 3rd argument that allows for the closest matching token to be returned + - By default, it continues to return the first matched token found from the top of the file +- Fixed detection of array return types for arrow functions +- Added Generic.PHP.DisallowRequestSuperglobal to ban the use of the $_REQUEST superglobal + - Thanks to Morerice for the contribution +- Generic.ControlStructures.InlineControlStructure no longer shows errors for WHILE and FOR statements without a body + - Previously it required these to have curly braces, but there were no statements to enclose in them + - Thanks to Juliette Reinders Folmer for the patch +- PSR12.ControlStructures.BooleanOperatorPlacement can now be configured to enforce a specific operator position + - By default, the sniff ensures that operators are all at the begining or end of lines, but not a mix of both + - Set the allowOnly property to "first" to enforce all boolean operators to be at the start of a line + - Set the allowOnly property to "last" to enforce all boolean operators to be at the end of a line + - Thanks to Vincent Langlet for the patch +- PSR12.Files.ImportStatement now auto-fixes import statements by removing the leading slash + - Thanks to Michał Bundyra for the patch +- Squiz.ControlStructures.ForLoopDeclaration now has a setting to ignore newline characters + - Default remains FALSE, so newlines are not allowed within FOR definitions + - Override the "ignoreNewlines" setting in a ruleset.xml file to change +- Squiz.PHP.InnerFunctions now handles multiple nested anon classes correctly + +### Fixed +- Fixed bug #2497 : Sniff properties not set when referencing a sniff using relative paths or non-native slashes + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2657 : Squiz.WhiteSpace.FunctionSpacing can remove spaces between comment and first/last method during auto-fixing + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2688 : Case statements not tokenized correctly when switch is contained within ternary +- Fixed bug #2698 : PHPCS throws errors determining auto report width when shell_exec is disabled + - Thanks to Matthew Peveler for the patch +- Fixed bug #2730 : PSR12.ControlStructures.ControlStructureSpacing does not ignore comments between conditions + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2732 : PSR12.Files.FileHeader misidentifies file header in mixed content file +- Fixed bug #2745 : AbstractArraySniff wrong indices when mixed coalesce and ternary values + - Thanks to Michał Bundyra for the patch +- Fixed bug #2748 : Wrong end of statement for fn closures + - Thanks to Michał Bundyra for the patch +- Fixed bug #2751 : Autoload relative paths first to avoid confusion with files from the global include path + - Thanks to Klaus Purer for the patch +- Fixed bug #2763 : PSR12 standard reports errors for multi-line FOR definitions +- Fixed bug #2768 : Generic.Files.LineLength false positive for non-breakable strings at exactly the soft limit + - Thanks to Alex Miles for the patch +- Fixed bug #2773 : PSR2.Methods.FunctionCallSignature false positive when arrow function has array return type +- Fixed bug #2790 : PSR12.Traits.UseDeclaration ignores block comments + - Thanks to Vincent Langlet for the patch +- Fixed bug #2791 : PSR12.Functions.NullableTypeDeclaration false positive when ternary operator used with instanceof + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2802 : Can't specify a report file path using the tilde shortcut +- Fixed bug #2804 : PHP4-style typed properties not tokenized correctly + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2805 : Undefined Offset notice during live coding of arrow functions + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2843 : Tokenizer does not support alternative syntax for declare statements + - Thanks to Juliette Reinders Folmer for the patch + +## [3.5.3] - 2019-12-04 +### Changed +- The PHP 7.4 T_FN token has been made available for older versions + - T_FN represents the fn string used for arrow functions + - The double arrow becomes the scope opener, and uses a new T_FN_ARROW token type + - The token after the statement (normally a semicolon) becomes the scope closer + - The token is also associated with the opening and closing parenthesis of the statement + - Any functions named "fn" will cause have a T_FN token for the function name, but have no scope information + - Thanks to Michał Bundyra for the help with this change +- PHP 7.4 numeric separators are now tokenized in the same way when using older PHP versions + - Previously, a number like 1_000 would tokenize as T_LNUMBER (1), T_STRING (_000) + - Now, the number tokenizes as T_LNUMBER (1_000) + - Sniff developers should consider how numbers with underscores impact their custom sniffs +- The PHPCS file cache now takes file permissions into account + - The cache is now invalidated for a file when its permissions are changed +- File::getMethodParameters() now supports arrow functions +- File::getMethodProperties() now supports arrow functions +- Added Fixer::changeCodeBlockIndent() to change the indent of a code block while auto-fixing + - Can be used to either increase or decrease the indent + - Useful when moving the start position of something like a closure, where you want the content to also move +- Added Generic.Files.ExecutableFile sniff + - Ensures that files are not executable + - Thanks to Matthew Peveler for the contribution +- Generic.CodeAnalysis.EmptyPhpStatement now reports unnecessary semicolons after control structure closing braces + - Thanks to Vincent Langlet for the patch +- Generic.PHP.LowerCaseKeyword now enforces that the "fn" keyword is lowercase + - Thanks to Michał Bundyra for the patch +- Generic.WhiteSpace.ScopeIndent now supports static arrow functions +- PEAR.Functions.FunctionCallSignature now adjusts the indent of function argument contents during auto-fixing + - Previously, only the first line of an argument was changed, leading to inconsistent indents + - This change also applies to PSR2.Methods.FunctionCallSignature +- PSR2.ControlStructures.ControlStructureSpacing now checks whitespace before the closing parenthesis of multi-line control structures + - Previously, it incorrectly applied the whitespace check for single-line definitions only +- PSR12.Functions.ReturnTypeDeclaration now checks the return type of arrow functions + - Thanks to Michał Bundyra for the patch +- PSR12.Traits.UseDeclaration now ensures all trait import statements are grouped together + - Previously, the trait import section of the class ended when the first non-import statement was found + - Checking now continues throughout the class to ensure all statements are grouped together + - This also ensures that empty lines are not requested after an import statement that isn't the last one +- Squiz.Functions.LowercaseFunctionKeywords now enforces that the "fn" keyword is lowercase + - Thanks to Michał Bundyra for the patch + +### Fixed +- Fixed bug #2586 : Generic.WhiteSpace.ScopeIndent false positives when indenting open tags at a non tab-stop +- Fixed bug #2638 : Squiz.CSS.DuplicateClassDefinitionSniff sees comments as part of the class name + - Thanks to Raphael Horber for the patch +- Fixed bug #2640 : Squiz.WhiteSpace.OperatorSpacing false positives for some negation operators + - Thanks to Jakub Chábek and Juliette Reinders Folmer for the patch +- Fixed bug #2674 : Squiz.Functions.FunctionDeclarationArgumentSpacing prints wrong argument name in error message +- Fixed bug #2676 : PSR12.Files.FileHeader locks up when file ends with multiple inline comments +- Fixed bug #2678 : PSR12.Classes.AnonClassDeclaration incorrectly enforcing that closing brace be on a line by itself +- Fixed bug #2685 : File::getMethodParameters() setting typeHintEndToken for vars with no type hint + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2694 : AbstractArraySniff produces invalid indices when using ternary operator + - Thanks to Michał Bundyra for the patch +- Fixed bug #2702 : Generic.WhiteSpace.ScopeIndent false positive when using ternary operator with short arrays + +## [3.5.2] - 2019-10-28 +### Changed +- Generic.ControlStructures.DisallowYodaConditions now returns less false positives + - False positives were being returned for array comparisions, or when performing some function calls +- Squiz.WhiteSpace.SemicolonSpacing.Incorrect error message now escapes newlines and tabs + - Provides a clearer error message as whitespace is now visible + - Also allows for better output for report types such as CSV and XML +- The error message for PSR12.Files.FileHeader.SpacingAfterBlock has been made clearer + - It now uses the wording from the published PSR-12 standard to indicate that blocks must be separated by a blank line + - Thanks to Craig Duncan for the patch + +### Fixed +- Fixed bug #2654 : Incorrect indentation for arguments of multiline function calls +- Fixed bug #2656 : Squiz.WhiteSpace.MemberVarSpacing removes comments before first member var during auto fixing + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2663 : Generic.NamingConventions.ConstructorName complains about old constructor in interfaces +- Fixed bug #2664 : PSR12.Files.OpenTag incorrectly identifies PHP file with only an opening tag +- Fixed bug #2665 : PSR12.Files.ImportStatement should not apply to traits +- Fixed bug #2673 : PSR12.Traits.UseDeclaration does not allow comments or blank lines between use statements + +## [3.5.1] - 2019-10-17 +### Changed +- Very very verbose diff report output has slightly changed to improve readability + - Output is printed when running PHPCS with the --report=diff and -vvv command line arguments + - Fully qualified class names have been replaced with sniff codes + - Tokens being changed now display the line number they are on +- PSR2, PSR12, and PEAR standards now correctly check for blank lines at the start of function calls + - This check has been missing from these standards, but has now been implemented + - When using the PEAR standard, the error code is PEAR.Functions.FunctionCallSignature.FirstArgumentPosition + - When using PSR2 or PSR12, the error code is PSR2.Methods.FunctionCallSignature.FirstArgumentPosition +- PSR12.ControlStructures.BooleanOperatorPlacement no longer complains when multiple expression appears on the same line + - Previously, boolean operators were enforce to appear at the start or end of lines only + - Boolean operators can now appear in the middle of the line +- PSR12.Files.FileHeader no longer ignores comments preceding a use, namespace, or declare statement +- PSR12.Files.FileHeader now allows a hashbang line at the top of the file + +### Fixed +- Fixed bug #2506 : PSR2 standard can't auto fix multi-line function call inside a string concat statement +- Fixed bug #2530 : PEAR.Commenting.FunctionComment does not support intersection types in comments +- Fixed bug #2615 : Constant visibility false positive on non-class constants +- Fixed bug #2616 : PSR12.Files.FileHeader false positive when file only contains docblock +- Fixed bug #2619 : PSR12.Files.FileHeader locks up when inline comment is the last content in a file +- Fixed bug #2621 : PSR12.Classes.AnonClassDeclaration.CloseBraceSameLine false positive for anon class passed as function argument + - Thanks to Martins Sipenko for the patch +- Fixed bug #2623 : PSR12.ControlStructures.ControlStructureSpacing not ignoring indentation inside multi-line string arguments +- Fixed bug #2624 : PSR12.Traits.UseDeclaration doesnt apply the correct indent during auto fixing +- Fixed bug #2626 : PSR12.Files.FileHeader detects @var annotations as file docblocks +- Fixed bug #2628 : PSR12.Traits.UseDeclaration does not allow comments above a USE declaration +- Fixed bug #2632 : Incorrect indentation of lines starting with "static" inside closures +- Fixed bug #2641 : PSR12.Functions.NullableTypeDeclaration false positive when using new static() + +## [3.5.0] - 2019-09-27 +### Changed +- The included PSR12 standard is now complete and ready to use + - Check your code using PSR-12 by running PHPCS with --standard=PSR12 +- Added support for PHP 7.4 typed properties + - The nullable operator is now tokenized as T_NULLABLE inside property types, as it is elsewhere + - To get the type of a member var, use the File::getMemberProperties() method, which now contains a "type" array index + - This contains the type of the member var, or a blank string if not specified + - If the type is nullable, the return type will contain the leading ? + - If a type is specified, the position of the first token in the type will be set in a "type_token" array index + - If a type is specified, the position of the last token in the type will be set in a "type_end_token" array index + - If the type is nullable, a "nullable_type" array index will also be set to TRUE + - If the type contains namespace information, it will be cleaned of whitespace and comments in the return value +- The PSR1 standard now correctly bans alternate PHP tags + - Previously, it only banned short open tags and not the pre-7.0 alternate tags +- Added support for only checking files that have been locally staged in a git repo + - Use --filter=gitstaged to check these files + - You still need to give PHPCS a list of files or directories in which to apply the filter + - Thanks to Juliette Reinders Folmer for the contribution +- JSON reports now end with a newline character +- The phpcs.xsd schema now validates phpcs-only and phpcbf-only attributes correctly + - Thanks to Juliette Reinders Folmer for the patch +- The tokenizer now correctly identifies inline control structures in more cases +- All helper methods inside the File class now throw RuntimeException instead of TokenizerException + - Some tokenizer methods were also throwing RuntimeExpection but now correctly throw TokenizerException + - Thanks to Juliette Reinders Folmer for the patch +- The File::getMethodParameters() method now returns more information, and supports closure USE groups + - If a type hint is specified, the position of the last token in the hint will be set in a "type_hint_end_token" array index + - If a default is specified, the position of the first token in the default value will be set in a "default_token" array index + - If a default is specified, the position of the equals sign will be set in a "default_equal_token" array index + - If the param is not the last, the position of the comma will be set in a "comma_token" array index + - If the param is passed by reference, the position of the reference operator will be set in a "reference_token" array index + - If the param is variable length, the position of the variadic operator will be set in a "variadic_token" array index +- The T_LIST token and it's opening and closing parentheses now contain references to each other in the tokens array + - Uses the same parenthesis_opener/closer/owner indexes as other tokens + - Thanks to Juliette Reinders Folmer for the patch +- The T_ANON_CLASS token and it's opening and closing parentheses now contain references to each other in the tokens array + - Uses the same parenthesis_opener/closer/owner indexes as other tokens + - Only applicable if the anon class is passing arguments to the constructor + - Thanks to Juliette Reinders Folmer for the patch +- The PHP 7.4 T_BAD_CHARACTER token has been made available for older versions + - Allows you to safely look for this token, but it will not appear unless checking with PHP 7.4+ +- Metrics are now available for Squiz.WhiteSpace.FunctionSpacing + - Use the "info" report to see blank lines before/after functions + - Thanks to Juliette Reinders Folmer for the patch +- Metrics are now available for Squiz.WhiteSpace.MemberVarSpacing + - Use the "info" report to see blank lines before member vars + - Thanks to Juliette Reinders Folmer for the patch +- Added Generic.ControlStructures.DisallowYodaConditions sniff + - Ban the use of Yoda conditions + - Thanks to Mponos George for the contribution +- Added Generic.PHP.RequireStrictTypes sniff + - Enforce the use of a strict types declaration in PHP files +- Added Generic.WhiteSpace.SpreadOperatorSpacingAfter sniff + - Checks whitespace between the spread operator and the variable/function call it applies to + - Thanks to Juliette Reinders Folmer for the contribution +- Added PSR12.Classes.AnonClassDeclaration sniff + - Enforces the formatting of anonymous classes +- Added PSR12.Classes.ClosingBrace sniff + - Enforces that closing braces of classes/interfaces/traits/functions are not followed by a comment or statement +- Added PSR12.ControlStructures.BooleanOperatorPlacement sniff + - Enforces that boolean operators between conditions are consistently at the start or end of the line +- Added PSR12.ControlStructures.ControlStructureSpacing sniff + - Enforces that spacing and indents are correct inside control structure parenthesis +- Added PSR12.Files.DeclareStatement sniff + - Enforces the formatting of declare statements within a file +- Added PSR12.Files.FileHeader sniff + - Enforces the order and formatting of file header blocks +- Added PSR12.Files.ImportStatement sniff + - Enforces the formatting of import statements within a file +- Added PSR12.Files.OpenTag sniff + - Enforces that the open tag is on a line by itself when used at the start of a php-only file +- Added PSR12.Functions.ReturnTypeDeclaration sniff + - Enforces the formatting of return type declarations in functions and closures +- Added PSR12.Properties.ConstantVisibility sniff + - Enforces that constants must have their visibility defined + - Uses a warning instead of an error due to this conditionally requiring the project to support PHP 7.1+ +- Added PSR12.Traits.UseDeclaration sniff + - Enforces the formatting of trait import statements within a class +- Generic.Files.LineLength ignoreComments property now ignores comments at the end of a line + - Previously, this property was incorrectly causing the sniff to ignore any line that ended with a comment + - Now, the trailing comment is not included in the line length, but the rest of the line is still checked +- Generic.Files.LineLength now only ignores unwrappable comments when the comment is on a line by itself + - Previously, a short unwrappable comment at the end of the line would have the sniff ignore the entire line +- Generic.Functions.FunctionCallArgumentSpacing no longer checks spacing around assignment operators inside function calls + - Use the Squiz.WhiteSpace.OperatorSpacing sniff to enforce spacing around assignment operators + - Note that this sniff checks spacing around all assignment operators, not just inside function calls + - The Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals error has been removed + - use Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore instead + - The Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterEquals error has been removed + - use Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfter instead + - This also changes the PEAR/PSR2/PSR12 standards so they no longer check assignment operators inside function calls + - They were previously checking these operators when they should not have + - Thanks to Juliette Reinders Folmer for the patch +- Generic.WhiteSpace.ScopeIndent no longer performs exact indents checking for chained method calls + - Other sniffs can be used to enforce chained method call indent rules + - Thanks to Pieter Frenssen for the patch +- PEAR.WhiteSpace.ObjectOperatorIndent now supports multi-level chained statements + - When enabled, chained calls must be indented 1 level more or less than the previous line + - Set the new "multilevel" setting to TRUE in a ruleset.xml file to enable this behaviour + - Thanks to Marcos Passos for the patch +- PSR2.ControlStructures.ControlStructureSpacing now allows whitespace after the opening parenthesis if followed by a comment + - Thanks to Michał Bundyra for the patch +- PSR2.Classes.PropertyDeclaration now enforces a single space after a property type keyword + - The PSR2 standard itself excludes this new check as it is not defined in the written standard + - Using the PSR12 standard will enforce this check +- Squiz.Commenting.BlockComment no longer requires blank line before comment if it's the first content after the PHP open tag + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Functions.FunctionDeclarationArgumentSpacing now has more accurate error messages + - This includes renaming the SpaceAfterDefault error code to SpaceAfterEquals, which reflects the real error +- Squiz.Functions.FunctionDeclarationArgumentSpacing now checks for no space after a reference operator + - If you don't want this new behaviour, exclude the SpacingAfterReference error message in a ruleset.xml file +- Squiz.Functions.FunctionDeclarationArgumentSpacing now checks for no space after a variadic operator + - If you don't want this new behaviour, exclude the SpacingAfterVariadic error message in a ruleset.xml file +- Squiz.Functions.MultiLineFunctionDeclaration now has improved fixing for the FirstParamSpacing and UseFirstParamSpacing errors +- Squiz.Operators.IncrementDecrementUsage now suggests pre-increment of variables instead of post-increment + - This change does not enforce pre-increment over post-increment; only the suggestion has changed + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.PHP.DisallowMultipleAssignments now has a second error code for when assignments are found inside control structure conditions + - The new error code is Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure + - All other multiple assignment cases use the existing error code Squiz.PHP.DisallowMultipleAssignments.Found + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.FunctionSpacing now applies beforeFirst and afterLast spacing rules to nested functions + - Previously, these rules only applied to the first and last function in a class, interface, or trait + - These rules now apply to functions nested in any statement block, including other functions and conditions +- Squiz.WhiteSpace.OperatorSpacing now has improved handling of parse errors + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.OperatorSpacing now checks spacing around the instanceof operator + - Thanks to Jakub Chábek for the patch +- Squiz.WhiteSpace.OperatorSpacing can now enforce a single space before assignment operators + - Previously, the sniff this spacing as multiple assignment operators are sometimes aligned + - Now, you can set the ignoreSpacingBeforeAssignments sniff property to FALSE to enable checking + - Default remains TRUE, so spacing before assignments is not checked by default + - Thanks to Jakub Chábek for the patch + +### Fixed +- Fixed bug #2391 : Sniff-specific ignore rules inside rulesets are filtering out too many files + - Thanks to Juliette Reinders Folmer and Willington Vega for the patch +- Fixed bug #2478 : FunctionCommentThrowTag.WrongNumber when exception is thrown once but built conditionally +- Fixed bug #2479 : Generic.WhiteSpace.ScopeIndent error when using array destructing with exact indent checking +- Fixed bug #2498 : Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed autofix breaks heredoc +- Fixed bug #2502 : Generic.WhiteSpace.ScopeIndent false positives with nested switch indentation and case fall-through +- Fixed bug #2504 : Generic.WhiteSpace.ScopeIndent false positives with nested arrays and nowdoc string +- Fixed bug #2511 : PSR2 standard not checking if closing paren of single-line function declaration is on new line +- Fixed bug #2512 : Squiz.PHP.NonExecutableCode does not support alternate SWITCH control structure + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2522 : Text generator throws error when code sample line is too long + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2526 : XML report format has bad syntax on Windows + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2529 : Generic.Formatting.MultipleStatementAlignment wrong error for assign in string concat +- Fixed bug #2534 : Unresolvable installed_paths can lead to open_basedir errors + - Thanks to Oliver Nowak for the patch +- Fixed bug #2541 : Text doc generator does not allow for multi-line rule explanations + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2549 : Searching for a phpcs.xml file can throw warnings due to open_basedir restrictions + - Thanks to Matthew Peveler for the patch +- Fixed bug #2558 : PHP 7.4 throwing offset syntax with curly braces is deprecated message + - Thanks to Matthew Peveler for the patch +- Fixed bug #2561 : PHP 7.4 compatibility fix / implode argument order + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2562 : Inline WHILE triggers SpaceBeforeSemicolon incorrectly + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2565 : Generic.ControlStructures.InlineControlStructure confused by mixed short/long tags + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2566 : Author tag email validation doesn't support all TLDs + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2575 : Custom error messages don't have data replaced when cache is enabled +- Fixed bug #2601 : Squiz.WhiteSpace.FunctionSpacing incorrect fix when spacing is 0 +- Fixed bug #2608 : PSR2 throws errors for use statements when multiple namespaces are defined in a file + +## [3.4.2] - 2019-04-11 +### Changed +- Squiz.Arrays.ArrayDeclaration now has improved handling of syntax errors + +### Fixed +- Fixed an issue where the PCRE JIT on PHP 7.3 caused PHPCS to die when using the parallel option + - PHPCS now disables the PCRE JIT before running +- Fixed bug #2368 : MySource.PHP.AjaxNullComparison throws error when first function has no doc comment +- Fixed bug #2414 : Indention false positive in switch/case/if combination +- Fixed bug #2423 : Squiz.Formatting.OperatorBracket.MissingBrackets error with static +- Fixed bug #2450 : Indentation false positive when closure containing nested IF conditions used as function argument +- Fixed bug #2452 : LowercasePHPFunctions sniff failing on "new \File()" +- Fixed bug #2453 : Squiz.CSS.SemicolonSpacingSniff false positive when style name proceeded by an asterisk + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2464 : Fixer conflict between Generic.WhiteSpace.ScopeIndent and Squiz.WhiteSpace.ScopeClosingBrace when class indented 1 space +- Fixed bug #2465 : Excluding a sniff by path is not working +- Fixed bug #2467 : PHP open/close tags inside CSS files are replaced with internal PHPCS token strings when auto fixing + +## [3.4.1] - 2019-03-19 +### Changed +- The PEAR installable version of PHPCS was missing some files, which have been re-included in this release + - The code report was not previously available for PEAR installs + - The Generic.Formatting.SpaceBeforeCast sniff was not previously available for PEAR installs + - The Generic.WhiteSpace.LanguageConstructSpacing sniff was not previously available for PEAR installs + - Thanks to Juliette Reinders Folmer for the patch +- PHPCS will now refuse to run if any of the required PHP extensions are not loaded + - Previously, PHPCS only relied on requirements being checked by PEAR and Composer + - Thanks to Juliette Reinders Folmer for the patch +- Ruleset XML parsing errors are now displayed in a readable format so they are easier to correct + - Thanks to Juliette Reinders Folmer for the patch +- The PSR2 standard no longer throws duplicate errors for spacing around FOR loop parentheses + - Thanks to Juliette Reinders Folmer for the patch +- T_PHPCS_SET tokens now contain sniffCode, sniffProperty, and sniffPropertyValue indexes + - Sniffs can use this information instead of having to parse the token content manually +- Added more guard code for syntax errors to various CSS sniffs + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Commenting.DocComment error messages now contain the name of the comment tag that caused the error + - Thanks to Juliette Reinders Folmer for the patch +- Generic.ControlStructures.InlineControlStructure now handles syntax errors correctly + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Debug.JSHint now longer requires rhino and can be run directly from the npm install + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Files.LineEndings no longer adds superfluous new line at the end of JS and CSS files + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Formatting.DisallowMultipleStatements no longer tries fix lines containing phpcs:ignore statements + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Functions.FunctionCallArgumentSpacing now has improved performance and anonymous class support + - Thanks to Juliette Reinders Folmer for the patch +- Generic.WhiteSpace.ScopeIndent now respects changes to the "exact" property using phpcs:set mid-way through a file + - This allows you change the "exact" rule for only some parts of a file +- Generic.WhiteSpace.ScopeIndent now disables exact indent checking inside all arrays + - Previously, this was only done when using long array syntax, but it now works for short array syntax as well +- PEAR.Classes.ClassDeclaration now has improved handling of PHPCS annotations and tab indents +- PSR12.Classes.ClassInstantiation has changed it's error code from MissingParenthesis to MissingParentheses +- PSR12.Keywords.ShortFormTypeKeywords now ignores all spacing inside type casts during both checking and fixing + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Classes.LowercaseClassKeywords now examines the class keyword for anonymous classes + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.ControlStructures.ControlSignature now has improved handling of parse errors + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.PostStatementComment fixer no longer adds a blank line at the start of a JS file that begins with a comment + - Fixes a conflict between this sniff and the Squiz.WhiteSpace.SuperfluousWhitespace sniff + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.PostStatementComment now ignores comments inside control structure conditions, such as FOR loops + - Fixes a conflict between this sniff and the Squiz.ControlStructures.ForLoopDeclaration sniff + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.FunctionCommentThrowTag now has improved support for unknown exception types and namespaces + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.ControlStructures.ForLoopDeclaration has improved whitespace, closure, and empty expression support + - The SpacingAfterSecondNoThird error code has been removed as part of these fixes + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.CSS.ClassDefinitionOpeningBraceSpace now handles comments and indentation correctly + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.CSS.ClassDefinitionClosingBrace now handles comments, indentation, and multiple statements on the same line correctly + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.CSS.Opacity now handles comments correctly + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.CSS.SemicolonSpacing now handles comments and syntax errors correctly + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.NamingConventions.ValidVariableName now supports variables inside anonymous classes correctly + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.PHP.LowercasePHPFunctions now handles use statements, namespaces, and comments correctly + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.FunctionSpacing now fixes function spacing correctly when a function is the first content in a file + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.SuperfluousWhitespace no longer throws errors for spacing between functions and properties in anon classes + - Thanks to Juliette Reinders Folmer for the patch +- Zend.Files.ClosingTag no longer adds a semi-colon during fixing of a file that only contains a comment + - Thanks to Juliette Reinders Folmer for the patch +- Zend.NamingConventions.ValidVariableName now supports variables inside anonymous classes correctly + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed bug #2298 : PSR2.Classes.ClassDeclaration allows extended class on new line + - Thanks to Michał Bundyra for the patch +- Fixed bug #2337 : Generic.WhiteSpace.ScopeIndent incorrect error when multi-line function call starts on same line as open tag +- Fixed bug #2348 : Cache not invalidated when changing a ruleset included by another +- Fixed bug #2376 : Using __halt_compiler() breaks Generic.PHP.ForbiddenFunctions unless it's last in the function list + - Thanks to Sijun Zhu for the patch +- Fixed bug #2393 : The gitmodified filter will infinitely loop when encountering deleted file paths + - Thanks to Lucas Manzke for the patch +- Fixed bug #2396 : Generic.WhiteSpace.ScopeIndent incorrect error when multi-line IF condition mixed with HTML +- Fixed bug #2431 : Use function/const not tokenized as T_STRING when preceded by comment + +## [3.4.0] - 2018-12-20 +### Deprecated +- The Generic.Formatting.NoSpaceAfterCast sniff has been deprecated and will be removed in version 4 + - The functionality of this sniff is now available in the Generic.Formatting.SpaceAfterCast sniff + - Include the Generic.Formatting.SpaceAfterCast sniff and set the "spacing" property to "0" + - As soon as possible, replace all instances of the old sniff code with the new sniff code and property setting + - The existing sniff will continue to work until version 4 has been released + +### Changed +- Rule include patterns in a ruleset.xml file are now evaluated as OR instead of AND + - Previously, a file had to match every include pattern and no exclude patterns to be included + - Now, a file must match at least one include pattern and no exclude patterns to be included + - This is a bug fix as include patterns are already documented to work this way +- New token T_BITWISE_NOT added for the bitwise not operator + - This token was previously tokenized as T_NONE + - Any sniffs specifically looking for T_NONE tokens with a tilde as the contents must now also look for T_BITWISE_NOT + - Sniffs can continue looking for T_NONE as well as T_BITWISE_NOT to support older PHP_CodeSniffer versions +- All types of binary casting are now tokenized as T_BINARY_CAST + - Previously, the 'b' in 'b"some string with $var"' would be a T_BINARY_CAST, but only when the string contained a var + - This change ensures the 'b' is always tokenized as T_BINARY_CAST + - This change also converts '(binary)' from T_STRING_CAST to T_BINARY_CAST + - Thanks to Juliette Reinders Folmer for the help with this patch +- Array properties set inside a ruleset.xml file can now extend a previous value instead of always overwriting it + - e.g., if you include a ruleset that defines forbidden functions, can you now add to that list instead of having to redefine it + - To use this feature, add extends="true" to the property tag + - e.g., property name="forbiddenFunctionNames" type="array" extend="true" + - Thanks to Michael Moravec for the patch +- If $XDG_CACHE_HOME is set and points to a valid directory, it will be used for caching instead of the system temp directory +- PHPCBF now disables parallel running if you are passing content on STDIN + - Stops an error from being shown after the fixed output is printed +- The progress report now shows files with tokenizer errors as skipped (S) instead of a warning (W) + - The tokenizer error is still displayed in reports as normal + - Thanks to Juliette Reinders Folmer for the patch +- The Squiz standard now ensures there is no space between an increment/decrement operator and its variable +- The File::getMethodProperties() method now includes a has_body array index in the return value + - FALSE if the method has no body (as with abstract and interface methods) or TRUE otherwise + - Thanks to Chris Wilkinson for the patch +- The File::getTokensAsString() method now throws an exception if the $start param is invalid + - If the $length param is invalid, an empty string will be returned + - Stops an infinite loop when the function is passed invalid data + - Thanks to Juliette Reinders Folmer for the patch +- Added new Generic.CodeAnalysis.EmptyPHPStatement sniff + - Warns when it finds empty PHP open/close tag combinations or superfluous semicolons + - Thanks to Juliette Reinders Folmer for the contribution +- Added new Generic.Formatting.SpaceBeforeCast sniff + - Ensures there is exactly 1 space before a type cast, unless the cast statement is indented or multi-line + - Thanks to Juliette Reinders Folmer for the contribution +- Added new Generic.VersionControl.GitMergeConflict sniff + - Detects merge conflict artifacts left in files + - Thanks to Juliette Reinders Folmer for the contribution +- Added Generic.WhiteSpace.IncrementDecrementSpacing sniff + - Ensures there is no space between the operator and the variable it applies to + - Thanks to Juliette Reinders Folmer for the contribution +- Added PSR12.Functions.NullableTypeDeclaration sniff + - Ensures there is no space after the question mark in a nullable type declaration + - Thanks to Timo Schinkel for the contribution +- A number of sniffs have improved support for methods in anonymous classes + - These sniffs would often throw the same error twice for functions in nested classes + - Error messages have also been changed to be less confusing + - The full list of affected sniffs is: + - Generic.NamingConventions.CamelCapsFunctionName + - PEAR.NamingConventions.ValidFunctionName + - PSR1.Methods.CamelCapsMethodName + - PSR2.Methods.MethodDeclaration + - Squiz.Scope.MethodScope + - Squiz.Scope.StaticThisUsage + - Thanks to Juliette Reinders Folmer for the patch +- Generic.CodeAnalysis.UnusedFunctionParameter now only skips functions with empty bodies when the class implements an interface + - Thanks to Juliette Reinders Folmer for the patch +- Generic.CodeAnalysis.UnusedFunctionParameter now has additional error codes to indicate where unused params were found + - The new error code prefixes are: + - FoundInExtendedClass: when the class extends another + - FoundInImplementedInterface: when the class implements an interface + - Found: used in all other cases, including closures + - The new error code suffixes are: + - BeforeLastUsed: the unused param was positioned before the last used param in the function signature + - AfterLastUsed: the unused param was positioned after the last used param in the function signature + - This makes the new error code list for this sniff: + - Found + - FoundBeforeLastUsed + - FoundAfterLastUsed + - FoundInExtendedClass + - FoundInExtendedClassBeforeLastUsed + - FoundInExtendedClassAfterLastUsed + - FoundInImplementedInterface + - FoundInImplementedInterfaceBeforeLastUsed + - FoundInImplementedInterfaceAfterLastUsed + - These errors code make it easier for specific cases to be ignored or promoted using a ruleset.xml file + - Thanks to Juliette Reinders Folmer for the contribution +- Generic.Classes.DuplicateClassName now inspects traits for duplicate names as well as classes and interfaces + - Thanks to Chris Wilkinson for the patch +- Generic.Files.InlineHTML now ignores a BOM at the start of the file + - Thanks to Chris Wilkinson for the patch +- Generic.PHP.CharacterBeforePHPOpeningTag now ignores a BOM at the start of the file + - Thanks to Chris Wilkinson for the patch +- Generic.Formatting.SpaceAfterCast now has a setting to specify how many spaces are required after a type cast + - Default remains 1 + - Override the "spacing" setting in a ruleset.xml file to change + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Formatting.SpaceAfterCast now has a setting to ignore newline characters after a type cast + - Default remains FALSE, so newlines are not allowed + - Override the "ignoreNewlines" setting in a ruleset.xml file to change + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Formatting.SpaceAfterNot now has a setting to specify how many spaces are required after a NOT operator + - Default remains 1 + - Override the "spacing" setting in a ruleset.xml file to change + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Formatting.SpaceAfterNot now has a setting to ignore newline characters after the NOT operator + - Default remains FALSE, so newlines are not allowed + - Override the "ignoreNewlines" setting in a ruleset.xml file to change + - Thanks to Juliette Reinders Folmer for the patch +- PEAR.Functions.FunctionDeclaration now checks spacing before the opening parenthesis of functions with no body + - Thanks to Chris Wilkinson for the patch +- PEAR.Functions.FunctionDeclaration now enforces no space before the semicolon in functions with no body + - Thanks to Chris Wilkinson for the patch +- PSR2.Classes.PropertyDeclaration now checks the order of property modifier keywords + - This is a rule that is documented in PSR-2 but was not enforced by the included PSR2 standard until now + - This sniff is also able to fix the order of the modifier keywords if they are incorrect + - Thanks to Juliette Reinders Folmer for the patch +- PSR2.Methods.MethodDeclaration now checks method declarations inside traits + - Thanks to Chris Wilkinson for the patch +- Squiz.Commenting.InlineComment now has better detection of comment block boundaries +- Squiz.Classes.ClassFileName now checks that a trait name matches the filename + - Thanks to Chris Wilkinson for the patch +- Squiz.Classes.SelfMemberReference now supports scoped declarations and anonymous classes + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Classes.SelfMemberReference now fixes multiple errors at once, increasing fixer performance + - Thanks to Gabriel Ostrolucký for the patch +- Squiz.Functions.LowercaseFunctionKeywords now checks abstract and final prefixes, and auto-fixes errors + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Objects.ObjectMemberComma.Missing has been renamed to Squiz.Objects.ObjectMemberComma.Found + - The error is thrown when the comma is found but not required, so the error code was incorrect + - If you are referencing the old error code in a ruleset XML file, please use the new code instead + - If you wish to maintain backwards compatibility, you can provide rules for both the old and new codes + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.ObjectOperatorSpacing is now more tolerant of parse errors +- Squiz.WhiteSpace.ObjectOperatorSpacing now fixes errors more efficiently + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed bug #2109 : Generic.Functions.CallTimePassByReference false positive for bitwise and used in function argument +- Fixed bug #2165 : Conflict between Squiz.Arrays.ArrayDeclaration and ScopeIndent sniffs when heredoc used in array +- Fixed bug #2167 : Generic.WhiteSpace.ScopeIndent shows invalid error when scope opener indented inside inline HTML +- Fixed bug #2178 : Generic.NamingConventions.ConstructorName matches methods in anon classes with same name as containing class + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2190 : PEAR.Functions.FunctionCallSignature incorrect error when encountering trailing PHPCS annotation + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2194 : Generic.Whitespace.LanguageConstructSpacing should not be checking namespace operators + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2202 : Squiz.WhiteSpace.OperatorSpacing throws error for negative index when using curly braces for string access + - Same issue fixed in Squiz.Formatting.OperatorBracket + - Thanks to Andreas Buchenrieder for the patch +- Fixed bug #2210 : Generic.NamingConventions.CamelCapsFunctionName not ignoring SoapClient __getCookies() method + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2211 : PSR2.Methods.MethodDeclaration gets confused over comments between modifier keywords + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2212 : FUNCTION and CONST in use groups being tokenised as T_FUNCTION and T_CONST + - Thanks to Chris Wilkinson for the patch +- Fixed bug #2214 : File::getMemberProperties() is recognizing method params as properties + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2236 : Memory info measurement unit is Mb but probably should be MB +- Fixed bug #2246 : CSS tokenizer does not tokenize class names correctly when they contain the string NEW + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2278 : Squiz.Operators.ComparisonOperatorUsage false positive when inline IF contained in parentheses + - Thanks to Arnout Boks for the patch +- Fixed bug #2284 : Squiz.Functions.FunctionDeclarationArgumentSpacing removing type hint during fixing + - Thanks to Michał Bundyra for the patch +- Fixed bug #2297 : Anonymous class not tokenized correctly when used as argument to another anon class + - Thanks to Michał Bundyra for the patch + +## [2.9.2] - 2018-11-08 +### Changed +- PHPCS should now run under PHP 7.3 without deprecation warnings + - Thanks to Nick Wilde for the patch + +### Fixed +- Fixed bug #1496 : Squiz.Strings.DoubleQuoteUsage not unescaping dollar sign when fixing + - Thanks to Michał Bundyra for the patch +- Fixed bug #1549 : Squiz.PHP.EmbeddedPhp fixer conflict with // comment before PHP close tag + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1890 : Incorrect Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose error between catch and finally statements + +## [3.3.2] - 2018-09-24 +### Changed +- Fixed a problem where the report cache was not being cleared when the sniffs inside a standard were updated +- The info report (--report=info) now has improved formatting for metrics that span multiple lines + - Thanks to Juliette Reinders Folmer for the patch +- The unit test runner now skips .bak files when looking for test cases + - Thanks to Juliette Reinders Folmer for the patch +- The Squiz standard now ensures underscores are not used to indicate visibility of private members vars and methods + - Previously, this standard enforced the use of underscores +- Generic.PHP.NoSilencedErrors error messages now contain a code snippet to show the context of the error + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Arrays.ArrayDeclaration no longer reports errors for a comma on a line new after a here/nowdoc + - Also stops a parse error being generated when auto-fixing + - The SpaceBeforeComma error message has been changed to only have one data value instead of two +- Squiz.Commenting.FunctionComment no longer errors when trying to fix indents of multi-line param comments +- Squiz.Formatting.OperatorBracket now correctly fixes statements that contain strings +- Squiz.PHP.CommentedOutCode now ignores more @-style annotations and includes better comment block detection + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed a problem where referencing a relative file path in a ruleset XML file could add unnecessary sniff exclusions + - This didn't actually exclude anything, but caused verbose output to list strange exclusion rules +- Fixed bug #2110 : Squiz.WhiteSpace.FunctionSpacing is removing indents from the start of functions when fixing + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2115 : Squiz.Commenting.VariableComment not checking var types when the @var line contains a comment +- Fixed bug #2120 : Tokenizer fails to match T_INLINE_ELSE when used after function call containing closure +- Fixed bug #2121 : Squiz.PHP.DisallowMultipleAssignments false positive in while loop conditions + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2127 : File::findExtendedClassName() doesn't support nested classes + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2138 : Tokenizer detects wrong token for php ::class feature with spaces +- Fixed bug #2143 : PSR2.Namespaces.UseDeclaration does not properly fix "use function" and "use const" statements + - Thanks to Chris Wilkinson for the patch +- Fixed bug #2144 : Squiz.Arrays.ArrayDeclaration does incorrect align calculation in array with cyrillic keys +- Fixed bug #2146 : Zend.Files.ClosingTag removes closing tag from end of file without inserting a semicolon +- Fixed bug #2151 : XML schema not updated with the new array property syntax + +## [3.3.1] - 2018-07-27 +### Removed +- Support for HHVM has been dropped due to recent unfixed bugs and HHVM refocus on Hack only + - Thanks to Walt Sorensen and Juliette Reinders Folmer for helping to remove all HHVM exceptions from the core + +### Changed +- The full report (the default report) now has improved word wrapping for multi-line messages and sniff codes + - Thanks to Juliette Reinders Folmer for the patch +- The summary report now sorts files based on their directory location instead of just a basic string sort + - Thanks to Juliette Reinders Folmer for the patch +- The source report now orders error codes by name when they have the same number of errors + - Thanks to Juliette Reinders Folmer for the patch +- The junit report no longer generates validation errors with the Jenkins xUnit plugin + - Thanks to Nikolay Geo for the patch +- Generic.Commenting.DocComment no longer generates the SpacingBeforeTags error if tags are the first content in the docblock + - The sniff will still generate a MissingShort error if there is no short comment + - This allows the MissingShort error to be suppressed in a ruleset to make short descriptions optional +- Generic.Functions.FunctionCallArgumentSpacing now properly fixes multi-line function calls with leading commas + - Previously, newlines between function arguments would be removed + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHP.Syntax will now use PHP_BINARY instead of trying to discover the executable path + - This ensures that the sniff will always syntax check files using the PHP version that PHPCS is running under + - Setting the php_path config var will still override this value as normal + - Thanks to Willem Stuursma-Ruwen for the patch +- PSR2.Namespaces.UseDeclaration now supports commas at the end of group use declarations + - Also improves checking and fixing for use statements containing parse errors + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Arrays.ArrayDeclaration no longer removes the array opening brace while fixing + - This could occur when the opening brace was on a new line and the first array key directly followed + - This change also stops the KeyNotAligned error message being incorrectly reported in these cases +- Squiz.Arrays.ArrayDeclaration no longer tries to change multi-line arrays to single line when they contain comments + - Fixes a conflict between this sniff and some indentation sniffs +- Squiz.Classes.ClassDeclaration no longer enforces spacing rules when a class is followed by a function + - Fixes a conflict between this sniff and the Squiz.WhiteSpace.FunctionSpacing sniff +- The Squiz.Classes.ValidClassName.NotCamelCaps message now references PascalCase instead of CamelCase + - The "CamelCase class name" metric produced by the sniff has been changed to "PascalCase class name" + - This reflects the fact that the class name check is actually a Pascal Case check and not really Camel Case + - Thanks to Tom H Anderson for the patch +- Squiz.Commenting.InlineComment no longer enforces spacing rules when an inline comment is followed by a docblock + - Fixes a conflict between this sniff and the Squiz.WhiteSpace.FunctionSpacing sniff +- Squiz.WhiteSpace.OperatorSpacing no longer tries to fix operator spacing if the next content is a comment on a new line + - Fixes a conflict between this sniff and the Squiz.Commenting.PostStatementComment sniff + - Also stops PHPCS annotations from being moved to a different line, potentially changing their meaning + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.FunctionSpacing no longer checks spacing of functions at the top of an embedded PHP block + - Fixes a conflict between this sniff and the Squiz.PHP.EmbeddedPHP sniff + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.MemberVarSpacing no longer checks spacing before member vars that come directly after methods + - Fixes a conflict between this sniff and the Squiz.WhiteSpace.FunctionSpacing sniff +- Squiz.WhiteSpace.SuperfluousWhitespace now recognizes unicode whitespace at the start and end of a file + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed bug #2029 : Squiz.Scope.MemberVarScope throws fatal error when a property is found in an interface + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2047 : PSR12.Classes.ClassInstantiation false positive when instantiating class from array index +- Fixed bug #2048 : GenericFormatting.MultipleStatementAlignment false positive when assigning values inside an array +- Fixed bug #2053 : PSR12.Classes.ClassInstantiation incorrectly fix when using member vars and some variable formats +- Fixed bug #2065 : Generic.ControlStructures.InlineControlStructure fixing fails when inline control structure contains closure +- Fixed bug #2072 : Squiz.Arrays.ArrayDeclaration throws NoComma error when array value is a shorthand IF statement +- Fixed bug #2082 : File with "defined() or define()" syntax triggers PSR1.Files.SideEffects.FoundWithSymbols +- Fixed bug #2095 : PSR2.Namespaces.NamespaceDeclaration does not handle namespaces defined over multiple lines + +## [3.3.0] - 2018-06-07 +### Deprecated +- The Squiz.WhiteSpace.LanguageConstructSpacing sniff has been deprecated and will be removed in version 4 + - The sniff has been moved to the Generic standard, with a new code of Generic.WhiteSpace.LanguageConstructSpacing + - As soon as possible, replace all instances of the old sniff code with the new sniff code in your ruleset.xml files + - The existing Squiz sniff will continue to work until version 4 has been released + - The new Generic sniff now also checks many more language constructs to enforce additional spacing rules + - Thanks to Mponos George for the contribution +- The current method for setting array properties in ruleset files has been deprecated and will be removed in version 4 + - Currently, setting an array value uses the string syntax "print=>echo,create_function=>null" + - Now, individual array elements are specified using a new "element" tag with "key" and "value" attributes + - For example, element key="print" value="echo" + - Thanks to Michał Bundyra for the patch +- The T_ARRAY_HINT token has been deprecated and will be removed in version 4 + - The token was used to ensure array type hints were not tokenized as T_ARRAY, but no other type hints were given a special token + - Array type hints now use the standard T_STRING token instead + - Sniffs referencing this token type will continue to run without error until version 4, but will not find any T_ARRAY_HINT tokens +- The T_RETURN_TYPE token has been deprecated and will be removed in version 4 + - The token was used to ensure array/self/parent/callable return types were tokenized consistently + - For namespaced return types, only the last part of the string (the class name) was tokenized as T_RETURN_TYPE + - This was not consistent and so return types are now left using their original token types so they are not skipped by sniffs + - The exception are array return types, which are tokenized as T_STRING instead of T_ARRAY, as they are for type hints + - Sniffs referencing this token type will continue to run without error until version 4, but will not find any T_RETUTN_TYPE tokens + - To get the return type of a function, use the File::getMethodProperties() method, which now contains a "return_type" array index + - This contains the return type of the function or closer, or a blank string if not specified + - If the return type is nullable, the return type will contain the leading ? + - A nullable_return_type array index in the return value will also be set to true + - If the return type contains namespace information, it will be cleaned of whitespace and comments + - To access the original return value string, use the main tokens array + +### Added +- This release contains an incomplete version of the PSR-12 coding standard + - Errors found using this standard should be valid, but it will miss a lot of violations until it is complete + - If you'd like to test and help, you can use the standard by running PHPCS with --standard=PSR12 + +### Changed +- Config values set using --runtime-set now override any config values set in rulesets or the CodeSniffer.conf file +- You can now apply include-pattern rules to individual message codes in a ruleset like you can with exclude-pattern rules + - Previously, include-pattern rules only applied to entire sniffs + - If a message code has both include and exclude patterns, the exclude patterns will be ignored +- Using PHPCS annotations to selectively re-enable sniffs is now more flexible + - Previously, you could only re-enable a sniff/category/standard using the exact same code that was disabled + - Now, you can disable a standard and only re-enable a specific category or sniff + - Or, you can disable a specific sniff and have it re-enable when you re-enable the category or standard +- The value of array sniff properties can now be set using phpcs:set annotations + - e.g., phpcs:set Standard.Category.SniffName property[] key=>value,key2=>value2 + - Thanks to Michał Bundyra for the patch +- PHPCS annotations now remain as T_PHPCS_* tokens instead of reverting to comment tokens when --ignore-annotations is used + - This stops sniffs (especially commenting sniffs) from generating a large number of false errors when ignoring + - Any custom sniffs that are using the T_PHPCS_* tokens to detect annotations may need to be changed to ignore them + - Check $phpcsFile->config->annotations to see if annotations are enabled and ignore when false +- You can now use fully or partially qualified class names for custom reports instead of absolute file paths + - To support this, you must specify an autoload file in your ruleset.xml file and use it to register an autoloader + - Your autoloader will need to load your custom report class when requested + - Thanks to Juliette Reinders Folmer for the patch +- The JSON report format now does escaping in error source codes as well as error messages + - Thanks to Martin Vasel for the patch +- Invalid installed_paths values are now ignored instead of causing a fatal error +- Improved testability of custom rulesets by allowing the installed standards to be overridden + - Thanks to Timo Schinkel for the patch +- The key used for caching PHPCS runs now includes all set config values + - This fixes a problem where changing config values (e.g., via --runtime-set) used an incorrect cache file +- The "Function opening brace placement" metric has been separated into function and closure metrics in the info report + - Closures are no longer included in the "Function opening brace placement" metric + - A new "Closure opening brace placement" metric now shows information for closures +- Multi-line T_YIELD_FROM statements are now replicated properly for older PHP versions +- The PSR2 standard no longer produces 2 error messages when the AS keyword in a foreach loop is not lowercase +- Specifying a path to a non-existent dir when using the --report-[reportType]=/path/to/report CLI option no longer throws an exception + - This now prints a readable error message, as it does when using --report-file +- The File::getMethodParamaters() method now includes a type_hint_token array index in the return value + - Provides the position in the token stack of the first token in the type hint +- The File::getMethodProperties() method now includes a return_type_token array index in the return value + - Provides the position in the token stack of the first token in the return type +- The File::getTokensAsString() method can now optionally return original (non tab-replaced) content + - Thanks to Juliette Reinders Folmer for the patch +- Removed Squiz.PHP.DisallowObEndFlush from the Squiz standard + - If you use this sniff and want to continue banning ob_end_flush(), use Generic.PHP.ForbiddenFunctions instead + - You will need to set the forbiddenFunctions property in your ruleset.xml file +- Removed Squiz.PHP.ForbiddenFunctions from the Squiz standard + - Replaced by using the forbiddenFunctions property of Generic.PHP.ForbiddenFunctions in the Squiz ruleset.xml + - Functionality of the Squiz standard remains the same, but the error codes are now different + - Previously, Squiz.PHP.ForbiddenFunctions.Found and Squiz.PHP.ForbiddenFunctions.FoundWithAlternative + - Now, Generic.PHP.ForbiddenFunctions.Found and Generic.PHP.ForbiddenFunctions.FoundWithAlternative +- Added new Generic.PHP.LowerCaseType sniff + - Ensures PHP types used for type hints, return types, and type casting are lowercase + - Thanks to Juliette Reinders Folmer for the contribution +- Added new Generic.WhiteSpace.ArbitraryParenthesesSpacing sniff + - Generates an error for whitespace inside parenthesis that don't belong to a function call/declaration or control structure + - Generates a warning for any empty parenthesis found + - Allows the required spacing to be set using the spacing sniff property (default is 0) + - Allows newlines to be used by setting the ignoreNewlines sniff property (default is false) + - Thanks to Juliette Reinders Folmer for the contribution +- Added new PSR12.Classes.ClassInstantiation sniff + - Ensures parenthesis are used when instantiating a new class +- Added new PSR12.Keywords.ShortFormTypeKeywords sniff + - Ensures the short form of PHP types is used when type casting +- Added new PSR12.Namespaces.CompundNamespaceDepth sniff + - Ensures compound namespace use statements have a max depth of 2 levels + - The max depth can be changed by setting the 'maxDepth' sniff property in a ruleset.xml file +- Added new PSR12.Operators.OperatorSpacing sniff + - Ensures operators are preceded and followed by at least 1 space +- Improved core support for grouped property declarations + - Also improves support in Squiz.WhiteSpace.ScopeKeywordSpacing and Squiz.WhiteSpace.MemberVarSpacing + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Commenting.DocComment now produces a NonParamGroup error when tags are mixed in with the @param tag group + - It would previously throw either a NonParamGroup or ParamGroup error depending on the order of tags + - This change allows the NonParamGroup error to be suppressed in a ruleset to allow the @param group to contain other tags + - Thanks to Phil Davis for the patch +- Generic.Commenting.DocComment now continues checks param tags even if the doc comment short description is missing + - This change allows the MissingShort error to be suppressed in a ruleset without all other errors being suppressed as well + - Thanks to Phil Davis for the patch +- Generic.CodeAnalysis.AssignmentInCondition now reports a different error code for assignments found in WHILE conditions + - The return value of a function call is often assigned in a WHILE condition, so this change makes it easier to exclude these cases + - The new code for this error message is Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition + - The error code for all other cases remains as Generic.CodeAnalysis.AssignmentInCondition.Found + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Functions.OpeningFunctionBraceBsdAllman now longer leaves trailing whitespace when moving the opening brace during fixing + - Also applies to fixes made by PEAR.Functions.FunctionDeclaration and Squiz.Functions.MultiLineFunctionDeclaration +- Generic.WhiteSpace.ScopeIndent now does a better job of fixing the indent of multi-line comments +- Generic.WhiteSpace.ScopeIndent now does a better job of fixing the indent of PHP open and close tags +- PEAR.Commenting.FunctionComment now report a different error code for param comment lines with too much padding + - Previously, any lines of a param comment that don't start at the exact comment position got the same error code + - Now, only comment lines with too little padding use ParamCommentAlignment as they are clearly mistakes + - Comment lines with too much padding may be using precision alignment as now use ParamCommentAlignmentExceeded + - This allows for excessive padding to be excluded from a ruleset while continuing to enforce a minimum padding +- PEAR.WhiteSpace.ObjectOperatorIndent now checks the indent of more chained operators + - Previously, it only checked chains beginning with a variable + - Now, it checks chains beginning with function calls, static class names, etc +- Squiz.Arrays.ArrayDeclaration now continues checking array formatting even if the key indent is not correct + - Allows for using different array indent rules while still checking/fixing double arrow and value alignment +- Squiz.Commenting.BlockComment has improved support for tab-indented comments + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.BlockComment auto fixing no longer breaks when two block comments follow each other + - Also stopped single-line block comments from being auto fixed when they are embedded in other code + - Also fixed as issue found when PHPCS annotations were used inside a block comment + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.BlockComment.LastLineIndent is now able to be fixed with phpcbf + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.BlockComment now aligns star-prefixed lines under the opening tag while fixing, instead of indenting them + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.FunctionComment.IncorrectTypeHint message no longer contains cut-off suggested type hints +- Squiz.Commenting.InlineComment now uses a new error code for inline comments at the end of a function + - Previously, all inline comments followed by a blank line threw a Squiz.Commenting.InlineComment.SpacingAfter error + - Now, inline comments at the end of a function will instead throw Squiz.Commenting.InlineComment.SpacingAfterAtFunctionEnd + - If you previously excluded SpacingAfter, add an exclusion for SpacingAfterAtFunctionEnd to your ruleset as well + - If you previously only included SpacingAfter, consider including SpacingAfterAtFunctionEnd as well + - The Squiz standard now excludes SpacingAfterAtFunctionEnd as the blank line is checked elsewhere + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.ControlStructures.ControlSignature now errors when a comment follows the closing brace of an earlier body + - Applies to catch, finally, else, elseif, and do/while structures + - The included PSR2 standard now enforces this rule + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Formatting.OperatorBracket.MissingBrackets message has been changed to remove the word "arithmetic" + - The sniff checks more than just arithmetic operators, so the message is now clearer +- Sniffs.Operators.ComparisonOperatorUsage now detects more cases of implicit true comparisons + - It could previously be confused by comparisons used as function arguments +- Squiz.PHP.CommentedOutCode now ignores simple @-style annotation comments so they are not flagged as commented out code + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.PHP.CommentedOutCode now ignores a greater number of short comments so they are not flagged as commented out code + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.PHP.DisallowComparisonAssignment no longer errors when using the null coalescing operator + - Given this operator is used almost exclusively to assign values, it didn't make sense to generate an error +- Squiz.WhiteSpacing.FunctionSpacing now has a property to specify how many blank lines should be before the first class method + - Only applies when a method is the first code block in a class (i.e., there are no member vars before it) + - Override the 'spacingBeforeFirst' property in a ruleset.xml file to change + - If not set, the sniff will use whatever value is set for the existing 'spacing' property +- Squiz.WhiteSpacing.FunctionSpacing now has a property to specify how many blank lines should be after the last class method + - Only applies when a method is the last code block in a class (i.e., there are no member vars after it) + - Override the 'spacingAfterLast' property in a ruleset.xml file to change + - If not set, the sniff will use whatever value is set for the existing 'spacing' property + +### Fixed +- Fixed bug #1863 : File::findEndOfStatement() not working when passed a scope opener +- Fixed bug #1876 : PSR2.Namespaces.UseDeclaration not giving error for use statements before the namespace declaration + - Adds a new PSR2.Namespaces.UseDeclaration.UseBeforeNamespace error message +- Fixed bug #1881 : Generic.Arrays.ArrayIndent is indenting sub-arrays incorrectly when comma not used after the last value +- Fixed bug #1882 : Conditional with missing braces confused by indirect variables +- Fixed bug #1915 : JS tokenizer fails to tokenize regular expression proceeded by boolean not operator +- Fixed bug #1920 : Directory exclude pattern improperly excludes files with names that start the same + - Thanks to Jeff Puckett for the patch +- Fixed bug #1922 : Equal sign alignment check broken when list syntax used before assignment operator +- Fixed bug #1925 : Generic.Formatting.MultipleStatementAlignment skipping assignments within closures +- Fixed bug #1931 : Generic opening brace placement sniffs do not correctly support function return types +- Fixed bug #1932 : Generic.ControlStructures.InlineControlStructure fixer moves new PHPCS annotations +- Fixed bug #1938 : Generic opening brace placement sniffs incorrectly move PHPCS annotations + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1939 : phpcs:set annotations do not cause the line they are on to be ignored + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1949 : Squiz.PHP.DisallowMultipleAssignments false positive when using namespaces with static assignments +- Fixed bug #1959 : SquizMultiLineFunctionDeclaration error when param has trailing comment + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1963 : Squiz.Scope.MemberVarScope does not work for multiline member declaration + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1971 : Short array list syntax not correctly tokenized if short array is the first content in a file +- Fixed bug #1979 : Tokenizer does not change heredoc to nowdoc token if the start tag contains spaces +- Fixed bug #1982 : Squiz.Arrays.ArrayDeclaration fixer sometimes puts a comma in front of the last array value +- Fixed bug #1993 : PSR1/PSR2 not reporting or fixing short open tags +- Fixed bug #1996 : Custom report paths don't work on case-sensitive filesystems +- Fixed bug #2006 : Squiz.Functions.FunctionDeclarationArgumentSpacing fixer removes comment between parens when no args + - The SpacingAfterOpenHint error message has been removed + - It is replaced by the the existing SpacingAfterOpen message + - The error message format for the SpacingAfterOpen and SpacingBeforeClose messages has been changed + - These used to contain 3 pieces of data, but now only contain 2 + - If you have customised the error messages of this sniff, please review your ruleset after upgrading +- Fixed bug #2018 : Generic.Formatting.MultipleStatementAlignment does see PHP close tag as end of statement block + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #2027 : PEAR.NamingConventions.ValidFunctionName error when function name includes double underscore + - Thanks to Juliette Reinders Folmer for the patch + +## [3.2.3] - 2018-02-21 +### Changed +- The new phpcs: comment syntax can now be prefixed with an at symbol ( @phpcs: ) + - This restores the behaviour of the previous syntax where these comments are ignored by doc generators +- The current PHP version ID is now used to generate cache files + - This ensures that only cache files generated by the current PHP version are selected + - This change fixes caching issues when using sniffs that produce errors based on the current PHP version +- A new Tokens::$phpcsCommentTokens array is now available for sniff developers to detect phpcs: comment syntax + - Thanks to Juliette Reinders Folmer for the patch +- The PEAR.Commenting.FunctionComment.Missing error message now includes the name of the function + - Thanks to Yorman Arias for the patch +- The PEAR.Commenting.ClassComment.Missing and Squiz.Commenting.ClassComment.Missing error messages now include the name of the class + - Thanks to Yorman Arias for the patch +- PEAR.Functions.FunctionCallSignature now only forces alignment at a specific tab stop while fixing + - It was enforcing this during checking, but this meant invalid errors if the OpeningIndent message was being muted + - This fixes incorrect errors when using the PSR2 standard with some code blocks +- Generic.Files.LineLength now ignores lines that only contain phpcs: annotation comments + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Formatting.MultipleStatementAlignment now skips over arrays containing comments + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHP.Syntax now forces display_errors to ON when linting + - Thanks to Raúl Arellano for the patch +- PSR2.Namespaces.UseDeclaration has improved syntax error handling and closure detection + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.PHP.CommentedOutCode now has improved comment block detection for improved accuracy + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.PHP.NonExecutableCode could fatal error while fixing file with syntax error +- Squiz.PHP.NonExecutableCode now detects unreachable code after a goto statement + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.LanguageConstructSpacing has improved syntax error handling while fixing + - Thanks to Juliette Reinders Folmer for the patch +- Improved phpcs: annotation syntax handling for a number of sniffs + - Thanks to Juliette Reinders Folmer for the patch +- Improved auto-fixing of files with incomplete comment blocks for various commenting sniffs + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed test suite compatibility with PHPUnit 7 +- Fixed bug #1793 : PSR2 forcing exact indent for function call opening statements +- Fixed bug #1803 : Squiz.WhiteSpace.ScopeKeywordSpacing removes member var name while fixing if no space after scope keyword +- Fixed bug #1817 : Blank line not enforced after control structure if comment on same line as closing brace +- Fixed bug #1827 : A phpcs:enable comment is not tokenized correctly if it is outside a phpcs:disable block + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1828 : Squiz.WhiteSpace.SuperfluousWhiteSpace ignoreBlankLines property ignores whitespace after single line comments + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1840 : When a comment has too many asterisks, phpcbf gives FAILED TO FIX error +- Fixed bug #1867 : Cant use phpcs:ignore where the next line is HTML +- Fixed bug #1870 : Invalid warning in multiple assignments alignment with closure or anon class +- Fixed bug #1890 : Incorrect Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose error between catch and finally statements +- Fixed bug #1891 : Comment on last USE statement causes false positive for PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse + - Thanks to Matt Coleman, Daniel Hensby, and Juliette Reinders Folmer for the patch +- Fixed bug #1901 : Fixed PHPCS annotations in multi-line tab-indented comments + not ignoring whole line for phpcs:set + - Thanks to Juliette Reinders Folmer for the patch + +## [3.2.2] - 2017-12-20 +### Changed +- Disabled STDIN detection on Windows + - This fixes a problem with IDE plugins (e.g., PHPStorm) hanging on Windows + +## [3.2.1] - 2017-12-18 +### Changed +- Empty diffs are no longer followed by a newline character (request #1781) +- Generic.Functions.OpeningFunctionBraceKernighanRitchie no longer complains when the open brace is followed by a close tag + - This makes the sniff more useful when used in templates + - Thanks to Joseph Zidell for the patch + +### Fixed +- Fixed problems with some scripts and plugins waiting for STDIN + - This was a notable problem with IDE plugins (e.g., PHPStorm) and build systems +- Fixed bug #1782 : Incorrect detection of operator in ternary + anonymous function + +## [3.2.0] - 2017-12-13 +### Deprecated +- This release deprecates the @codingStandards comment syntax used for sending commands to PHP_CodeSniffer + - The existing syntax will continue to work in all version 3 releases, but will be removed in version 4 + - The comment formats have been replaced by a shorter syntax: + - @codingStandardsIgnoreFile becomes phpcs:ignoreFile + - @codingStandardsIgnoreStart becomes phpcs:disable + - @codingStandardsIgnoreEnd becomes phpcs:enable + - @codingStandardsIgnoreLine becomes phpcs:ignore + - @codingStandardsChangeSetting becomes phpcs:set + - The new syntax allows for additional developer comments to be added after a -- separator + - This is useful for describing why a code block is being ignored, or why a setting is being changed + - E.g., phpcs:disable -- This code block must be left as-is. + - Comments using the new syntax are assigned new comment token types to allow them to be detected: + - phpcs:ignoreFile has the token T_PHPCS_IGNORE_FILE + - phpcs:disable has the token T_PHPCS_DISABLE + - phpcs:enable has the token T_PHPCS_ENABLE + - phpcs:ignore has the token T_PHPCS_IGNORE + - phpcs:set has the token T_PHPCS_SET + +### Changed +- The phpcs:disable and phpcs:ignore comments can now selectively ignore specific sniffs (request #604) + - E.g., phpcs:disable Generic.Commenting.Todo.Found for a specific message + - E.g., phpcs:disable Generic.Commenting.Todo for a whole sniff + - E.g., phpcs:disable Generic.Commenting for a whole category of sniffs + - E.g., phpcs:disable Generic for a whole standard + - Multiple sniff codes can be specified by comma separating them + - E.g., phpcs:disable Generic.Commenting.Todo,PSR1.Files +- @codingStandardsIgnoreLine comments now only ignore the following line if they are on a line by themselves + - If they are at the end of an existing line, they will only ignore the line they are on + - Stops some lines from accidentally being ignored + - Same rule applies for the new phpcs:ignore comment syntax +- PSR1.Files.SideEffects now respects the new phpcs:disable comment syntax + - The sniff will no longer check any code that is between phpcs:disable and phpcs:enable comments + - The sniff does not support phpcs:ignore; you must wrap code structures with disable/enable comments + - Previously, there was no way to have this sniff ignore parts of a file +- Fixed a problem where PHPCS would sometimes hang waiting for STDIN, or read incomplete versions of large files + - Thanks to Arne Jørgensen for the patch +- Array properties specified in ruleset files now have their keys and values trimmed + - This saves having to do this in individual sniffs and stops errors introduced by whitespace in rulesets + - Thanks to Juliette Reinders Folmer for the patch +- Added phpcs.xsd to allow validation of ruleset XML files + - Thanks to Renaat De Muynck for the contribution +- File paths specified using --stdin-path can now point to fake file locations (request #1488) + - Previously, STDIN files using fake file paths were excluded from checking +- Setting an empty basepath (--basepath=) on the CLI will now clear a basepath set directly in a ruleset + - Thanks to Xaver Loppenstedt for the patch +- Ignore patterns are now checked on symlink target paths instead of symlink source paths + - Restores previous behaviour of this feature +- Metrics were being double counted when multiple sniffs were recording the same metric +- Added support for bash process substitution + - Thanks to Scott Dutton for the contribution +- Files included in the cache file code hash are now sorted to aid in cache file reuse across servers +- Windows BAT files can now be used outside a PEAR install + - You must have the path to PHP set in your PATH environment variable + - Thanks to Joris Debonnet for the patch +- The JS unsigned right shift assignment operator is now properly classified as an assignment operator + - Thanks to Juliette Reinders Folmer for the patch +- The AbstractVariableSniff abstract sniff now supports anonymous classes and nested functions + - Also fixes an issue with Squiz.Scope.MemberVarScope where member vars of anonymous classes were not being checked +- Added AbstractArraySniff to make it easier to create sniffs that check array formatting + - Allows for checking of single and multi line arrays easily + - Provides a parsed structure of the array including positions of keys, values, and double arrows +- Added Generic.Arrays.ArrayIndent to enforce a single tab stop indent for array keys in multi-line arrays + - Also ensures the close brace is on a new line and indented to the same level as the original statement + - Allows for the indent size to be set using an "indent" property of the sniff +- Added Generic.PHP.DiscourageGoto to warn about the use of the GOTO language construct + - Thanks to Juliette Reinders Folmer for the contribution +- Generic.Debug.ClosureLinter was not running the gjslint command + - Thanks to Michał Bundyra for the patch +- Generic.WhiteSpace.DisallowSpaceIndent now fixes space indents in multi-line block comments + - Thanks to Juliette Reinders Folmer for the patch +- Generic.WhiteSpace.DisallowSpaceIndent now fixes mixed space/tab indents more accurately + - Thanks to Juliette Reinders Folmer for the patch +- Generic.WhiteSpace.DisallowTabIndent now fixes tab indents in multi-line block comments + - Thanks to Juliette Reinders Folmer for the patch +- PEAR.Functions.FunctionDeclaration no longer errors when a function declaration is the first content in a JS file + - Thanks to Juliette Reinders Folmer for the patch +- PEAR.Functions.FunctionCallSignature now requires the function name to be indented to an exact tab stop + - If the function name is not the start of the statement, the opening statement must be indented correctly instead + - Added a new fixable error code PEAR.Functions.FunctionCallSignature.OpeningIndent for this error +- Squiz.Functions.FunctionDeclarationArgumentSpacing is no longer confused about comments in function declarations + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.PHP.NonExecutableCode error messages now indicate which line the code block ending is on + - Makes it easier to identify where the code block exited or returned + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.FunctionComment now supports nullable type hints +- Squiz.Commenting.FunctionCommentThrowTag no longer assigns throw tags inside anon classes to the enclosing function +- Squiz.WhiteSpace.SemicolonSpacing now ignores semicolons used for empty statements inside FOR conditions + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.ControlStructures.ControlSignature now allows configuring the number of spaces before the colon in alternative syntax + - Override the 'requiredSpacesBeforeColon' setting in a ruleset.xml file to change + - Default remains at 1 + - Thanks to Nikola Kovacs for the patch +- The Squiz standard now ensures array keys are indented 4 spaces from the main statement + - Previously, this standard aligned keys 1 space from the start of the array keyword +- The Squiz standard now ensures array end braces are aligned with the main statement + - Previously, this standard aligned the close brace with the start of the array keyword +- The standard for PHP_CodeSniffer itself now enforces short array syntax +- The standard for PHP_CodeSniffer itself now uses the Generic.Arrays/ArrayIndent sniff rules +- Improved fixer conflicts and syntax error handling for a number of sniffs + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed bug #1462 : Error processing cyrillic strings in Tokenizer +- Fixed bug #1573 : Squiz.WhiteSpace.LanguageConstructSpacing does not properly check for tabs and newlines + - Thanks to Michał Bundyra for the patch +- Fixed bug #1590 : InlineControlStructure CBF issue while adding braces to an if thats returning a nested function +- Fixed bug #1718 : Unclosed strings at EOF sometimes tokenized as T_WHITESPACE by the JS tokenizer +- Fixed bug #1731 : Directory exclusions do not work as expected when a single file name is passed to phpcs +- Fixed bug #1737 : Squiz.CSS.EmptyStyleDefinition sees comment as style definition and fails to report error +- Fixed bug #1746 : Very large reports can sometimes become garbled when using the parallel option +- Fixed bug #1747 : Squiz.Scope.StaticThisUsage incorrectly looking inside closures +- Fixed bug #1757 : Unknown type hint "object" in Squiz.Commenting.FunctionComment +- Fixed bug #1758 : PHPCS gets stuck creating file list when processing circular symlinks +- Fixed bug #1761 : Generic.WhiteSpace.ScopeIndent error on multi-line function call with static closure argument +- Fixed bug #1762 : Generic.WhiteSpace.Disallow[Space/Tab]Indent not inspecting content before open tag + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1769 : Custom "define" function triggers a warning about declaring new symbols +- Fixed bug #1776 : Squiz.Scope.StaticThisUsage incorrectly looking inside anon classes +- Fixed bug #1777 : Generic.WhiteSpace.ScopeIndent incorrect indent errors when self called function proceeded by comment + +## [3.1.1] - 2017-10-17 +### Changed +- Restored preference of non-dist files over dist files for phpcs.xml and phpcs.xml.dist + - The order that the files are searched is now: .phpcs.xml, phpcs.xml, .phpcs.xml.dist, phpcs.xml.dist + - Thanks to Juliette Reinders Folmer for the patch +- Progress output now correctly shows skipped files +- Progress output now shows 100% when the file list has finished processing (request #1697) +- Stopped some IDEs complaining about testing class aliases + - Thanks to Vytautas Stankus for the patch +- Squiz.Commenting.InlineComment incorrectly identified comment blocks in some cases, muting some errors + - Thanks to Juliette Reinders Folmer for the patch + +### Fixed +- Fixed bug #1512 : PEAR.Functions.FunctionCallSignature enforces spaces when no arguments if required spaces is not 0 +- Fixed bug #1522 : Squiz Arrays.ArrayDeclaration and Strings.ConcatenationSpacing fixers causing parse errors with here/ nowdocs +- Fixed bug #1570 : Squiz.Arrays.ArrayDeclaration fixer removes comments between array keyword and open parentheses +- Fixed bug #1604 : File::isReference has problems with some bitwise operators and class property references + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1645 : Squiz.Commenting.InlineComment will fail to fix comments at the end of the file + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1656 : Using the --sniffs argument has a problem with case sensitivity +- Fixed bug #1657 : Uninitialized string offset: 0 when sniffing CSS +- Fixed bug #1669 : Temporary expression proceeded by curly brace is detected as function call +- Fixed bug #1681 : Huge arrays are super slow to scan with Squiz.Arrays.ArrayDeclaration sniff +- Fixed bug #1694 : Squiz.Arrays.ArrayBracketSpacing is removing some comments during fixing + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1702 : Generic.WhiteSpaceDisallowSpaceIndent fixer bug when line only contains superfluous whitespace + +## [3.1.0] - 2017-09-20 +### Changed +- This release includes a change to support newer versions of PHPUnit (versions 4, 5, and 6 are now supported) + - The custom PHP_CodeSniffer test runner now requires a bootstrap file + - Developers with custom standards using the PHP_CodeSniffer test runner will need to do one of the following: + - run your unit tests from the PHP_CodeSniffer root dir so the bootstrap file is included + - specify the PHP_CodeSniffer bootstrap file on the command line: phpunit --bootstrap=/path/to/phpcs/tests/bootstrap.php + - require the PHP_CodeSniffer bootstrap file from your own bootstrap file + - If you don't run PHP_CodeSniffer unit tests, this change will not affect you + - Thanks to Juliette Reinders Folmer for the patch +- A phpcs.xml or phpcs.xml.dist file now takes precedence over the default_standard config setting + - Thanks to Björn Fischer for the patch +- Both phpcs.xml and phpcs.xml.dist files can now be prefixed with a dot (request #1566) + - The order that the files are searched is: .phpcs.xml, .phpcs.xml.dist, phpcs.xml, phpcs.xml.dist +- The autoloader will now search for files during unit tests runs from the same locations as during normal phpcs runs + - Allows for easier unit testing of custom standards that use helper classes or custom namespaces +- Include patterns for sniffs now use OR logic instead of AND logic + - Previously, a file had to be in each of the include patterns to be processed by a sniff + - Now, a file has to only be in at least one of the patterns + - This change reflects the original intention of the feature +- PHPCS will now follow symlinks under the list of checked directories + - This previously only worked if you specified the path to a symlink on the command line +- Output from --config-show, --config-set, and --config-delete now includes the path to the loaded config file +- PHPCS now cleanly exits if its config file is not readable + - Previously, a combination of PHP notices and PHPCS errors would be generated +- Comment tokens that start with /** are now always tokenized as docblocks + - Thanks to Michał Bundyra for the patch +- The PHP-supplied T_YIELD and T_YIELD_FROM token have been replicated for older PHP versions + - Thanks to Michał Bundyra for the patch +- Added new Generic.CodeAnalysis.AssignmentInCondition sniff to warn about variable assignments inside conditions + - Thanks to Juliette Reinders Folmer for the contribution +- Added Generic.Files.OneObjectStructurePerFile sniff to ensure there is a single class/interface/trait per file + - Thanks to Mponos George for the contribution +- Function call sniffs now check variable function names and self/static object creation + - Specific sniffs are Generic.Functions.FunctionCallArgumentSpacing, PEAR.Functions.FunctionCallSignature, and PSR2.Methods.FunctionCallSignature + - Thanks to Michał Bundyra for the patch +- Generic.Files.LineLength can now be configured to ignore all comment lines, no matter their length + - Set the ignoreComments property to TRUE (default is FALSE) in your ruleset.xml file to enable this + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHP.LowerCaseKeyword now checks self, parent, yield, yield from, and closure (function) keywords + - Thanks to Michał Bundyra for the patch +- PEAR.Functions.FunctionDeclaration now removes a blank line if it creates one by moving the curly brace during fixing +- Squiz.Commenting.FunctionCommentThrowTag now supports PHP 7.1 multi catch exceptions +- Squiz.Formatting.OperatorBracket no longer throws errors for PHP 7.1 multi catch exceptions +- Squiz.Commenting.LongConditionClosingComment now supports finally statements +- Squiz.Formatting.OperatorBracket now correctly fixes pipe separated flags +- Squiz.Formatting.OperatorBracket now correctly fixes statements containing short array syntax +- Squiz.PHP.EmbeddedPhp now properly fixes cases where the only content in an embedded PHP block is a comment + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.ControlStructureSpacing now ignores comments when checking blank lines at the top of control structures +- Squiz.WhiteSpace.ObjectOperatorSpacing now detects and fixes spaces around double colons + - Thanks to Julius Šmatavičius for the patch +- Squiz.WhiteSpace.MemberVarSpacing can now be configured to check any number of blank lines between member vars + - Set the spacing property (default is 1) in your ruleset.xml file to set the spacing +- Squiz.WhiteSpace.MemberVarSpacing can now be configured to check a different number of blank lines before the first member var + - Set the spacingBeforeFirst property (default is 1) in your ruleset.xml file to set the spacing +- Added a new PHP_CodeSniffer\Util\Tokens::$ooScopeTokens static member var for quickly checking object scope + - Includes T_CLASS, T_ANON_CLASS, T_INTERFACE, and T_TRAIT + - Thanks to Juliette Reinders Folmer for the patch +- PHP_CodeSniffer\Files\File::findExtendedClassName() now supports extended interfaces + - Thanks to Martin Hujer for the patch + +### Fixed +- Fixed bug #1550 : Squiz.Commenting.FunctionComment false positive when function contains closure +- Fixed bug #1577 : Generic.InlineControlStructureSniff breaks with a comment between body and condition in do while loops +- Fixed bug #1581 : Sniffs not loaded when one-standard directories are being registered in installed_paths +- Fixed bug #1591 : Autoloader failing to load arbitrary files when installed_paths only set via a custom ruleset +- Fixed bug #1605 : Squiz.WhiteSpace.OperatorSpacing false positive on unary minus after comment + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1615 : Uncaught RuntimeException when phpcbf fails to fix files +- Fixed bug #1637 : Generic.WhiteSpaceScopeIndent closure argument indenting incorrect with multi-line strings +- Fixed bug #1638 : Squiz.WhiteSpace.ScopeClosingBrace closure argument indenting incorrect with multi-line strings +- Fixed bug #1640 : Squiz.Strings.DoubleQuoteUsage replaces tabs with spaces when fixing + - Thanks to Juliette Reinders Folmer for the patch + +## [3.0.2] - 2017-07-18 +### Changed +- The code report now gracefully handles tokenizer exceptions +- The phpcs and phpcbf scripts and now the only places that exit() in the code + - This allows for easier usage of core PHPCS functions from external scripts + - If you are calling Runner::runPHPCS() or Runner::runPHPCBF() directly, you will get back the full range of exit codes + - If not, catch the new DeepExitException to get the error message ($e->getMessage()) and exit code ($e->getCode()); +- NOWDOC tokens are now considered conditions, just as HEREDOC tokens are + - This makes it easier to find the start and end of a NOWDOC from any token within it + - Thanks to Michał Bundyra for the patch +- Custom autoloaders are now only included once in case multiple standards are using the same one + - Thanks to Juliette Reinders Folmer for the patch +- Improved tokenizing of fallthrough CASE and DEFAULT statements that share a closing statement and use curly braces +- Improved the error message when Squiz.ControlStructures.ControlSignature detects a newline after the closing parenthesis + +### Fixed +- Fixed a problem where the source report was not printing the correct number of errors found +- Fixed a problem where the --cache=/path/to/cachefile CLI argument was not working +- Fixed bug #1465 : Generic.WhiteSpace.ScopeIndent reports incorrect errors when indenting double arrows in short arrays +- Fixed bug #1478 : Indentation in fallthrough CASE that contains a closure +- Fixed bug #1497 : Fatal error if composer prepend-autoloader is set to false + - Thanks to Kunal Mehta for the patch +- Fixed bug #1503 : Alternative control structure syntax not always recognized as scoped +- Fixed bug #1523 : Fatal error when using the --suffix argument + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1526 : Use of basepath setting can stop PHPCBF being able to write fixed files +- Fixed bug #1530 : Generic.WhiteSpace.ScopeIndent can increase indent too much for lines within code blocks +- Fixed bug #1547 : Wrong token type for backslash in use function + - Thanks to Michał Bundyra for the patch +- Fixed bug #1549 : Squiz.PHP.EmbeddedPhp fixer conflict with // comment before PHP close tag + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1560 : Squiz.Commenting.FunctionComment fatal error when fixing additional param comment lines that have no indent + +## [3.0.1] - 2017-06-14 +### Security +- This release contains a fix for a security advisory related to the improper handling of a shell command + - A properly crafted filename would allow for arbitrary code execution when using the --filter=gitmodified command line option + - All version 3 users are encouraged to upgrade to this version, especially if you are checking 3rd-party code + - e.g., you run PHPCS over libraries that you did not write + - e.g., you provide a web service that runs PHPCS over user-uploaded files or 3rd-party repositories + - e.g., you allow external tool paths to be set by user-defined values + - If you are unable to upgrade but you check 3rd-party code, ensure you are not using the Git modified filter + - This advisory does not affect PHP_CodeSniffer version 2. + - Thanks to Sergei Morozov for the report and patch + +### Changed +- Arguments on the command line now override or merge with those specified in a ruleset.xml file in all cases +- PHPCS now stops looking for a phpcs.xml file as soon as one is found, favoring the closest one to the current dir +- Added missing help text for the --stdin-path CLI option to --help +- Re-added missing help text for the --file-list and --bootstrap CLI options to --help +- Runner::runPHPCS() and Runner::runPHPCBF() now return an exit code instead of exiting directly (request #1484) +- The Squiz standard now enforces short array syntax by default +- The autoloader is now working correctly with classes created with class_alias() +- The autoloader will now search for files inside all directories in the installed_paths config var + - This allows autoloading of files inside included custom coding standards without manually requiring them +- You can now specify a namespace for a custom coding standard, used by the autoloader to load non-sniff helper files + - Also used by the autoloader to help other standards directly include sniffs for your standard + - Set the value to the namespace prefix you are using for sniff files (everything up to \Sniffs\) + - e.g., if your namespace format is MyProject\CS\Standard\Sniffs\Category set the namespace to MyProject\CS\Standard + - If omitted, the namespace is assumed to be the same as the directory name containing the ruleset.xml file + - The namespace is set in the ruleset tag of the ruleset.xml file + - e.g., ruleset name="My Coding Standard" namespace="MyProject\CS\Standard" +- Rulesets can now specify custom autoloaders using the new autoload tag + - Autoloaders are included while the ruleset is being processed and before any custom sniffs are included + - Allows for very custom autoloading of helper classes well before the boostrap files are included +- The PEAR standard now includes Squiz.Commenting.DocCommentAlignment + - It previously broke comments onto multiple lines, but didn't align them + +### Fixed +- Fixed a problem where excluding a message from a custom standard's own sniff would exclude the whole sniff + - This caused some PSR2 errors to be under-reported +- Fixed bug #1442 : T_NULLABLE detection not working for nullable parameters and return type hints in some cases +- Fixed bug #1447 : Running the unit tests with a phpunit config file breaks the test suite + - Unknown arguments were not being handled correctly, but are now stored in $config->unknown +- Fixed bug #1449 : Generic.Classes.OpeningBraceSameLine doesn't detect comment before opening brace + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1450 : Coding standard located under an installed_path with the same directory name throws an error + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1451 : Sniff exclusions/restrictions dont work with custom sniffs unless they use the PHP_CodeSniffer NS +- Fixed bug #1454 : Squiz.WhiteSpace.OperatorSpacing is not checking spacing on either side of a short ternary operator + - Thanks to Mponos George for the patch +- Fixed bug #1495 : Setting an invalid installed path breaks all commands +- Fixed bug #1496 : Squiz.Strings.DoubleQuoteUsage not unescaping dollar sign when fixing + - Thanks to Michał Bundyra for the patch +- Fixed bug #1501 : Interactive mode is broken +- Fixed bug #1504 : PSR2.Namespaces.UseDeclaration hangs fixing use statement with no trailing code + +## [2.9.1] - 2017-05-22 +### Fixed +- Fixed bug #1442 : T_NULLABLE detection not working for nullable parameters and return type hints in some cases +- Fixed bug #1448 : Generic.Classes.OpeningBraceSameLine doesn't detect comment before opening brace + - Thanks to Juliette Reinders Folmer for the patch + +## [3.0.0] - 2017-05-04 +### Changed +- Added an --ignore-annotations command line argument to ignore all @codingStandards annotations in code comments (request #811) +- This allows you to force errors to be shown that would otherwise be ignored by code comments + - Also stop files being able to change sniff properties mid way through processing +- An error is now reported if no sniffs were registered to be run (request #1129) +- The autoloader will now search for files inside the directory of any loaded coding standard + - This allows autoloading of any file inside a custom coding standard without manually requiring them + - Ensure your namespace begins with your coding standard's directory name and follows PSR-4 + - e.g., StandardName\Sniffs\CategoryName\AbstractHelper or StandardName\Helpers\StringSniffHelper +- Fixed an error where STDIN was sometimes not checked when using the --parallel CLI option +- The is_closure index has been removed from the return value of File::getMethodProperties() + - This value was always false because T_FUNCTION tokens are never closures + - Closures have a token type of T_CLOSURE +- The File::isAnonymousFunction() method has been removed + - This function always returned false because it only accepted T_FUNCTION tokens, which are never closures + - Closures have a token type of T_CLOSURE +- Includes all changes from the 2.9.0 release + +### Fixed +- Fixed bug #834 : PSR2.ControlStructures.SwitchDeclaration does not handle if branches with returns + - Thanks to Fabian Wiget for the patch + +## [3.0.0RC4] - 2017-03-02 +### Security +- This release contains a fix for a security advisory related to the improper handling of shell commands + - Uses of shell_exec() and exec() were not escaping filenames and configuration settings in most cases + - A properly crafted filename or configuration option would allow for arbitrary code execution when using some features + - All users are encouraged to upgrade to this version, especially if you are checking 3rd-party code + - e.g., you run PHPCS over libraries that you did not write + - e.g., you provide a web service that runs PHPCS over user-uploaded files or 3rd-party repositories + - e.g., you allow external tool paths to be set by user-defined values + - If you are unable to upgrade but you check 3rd-party code, ensure you are not using the following features: + - The diff report + - The notify-send report + - The Generic.PHP.Syntax sniff + - The Generic.Debug.CSSLint sniff + - The Generic.Debug.ClosureLinter sniff + - The Generic.Debug.JSHint sniff + - The Squiz.Debug.JSLint sniff + - The Squiz.Debug.JavaScriptLint sniff + - The Zend.Debug.CodeAnalyzer sniff + - Thanks to Klaus Purer for the report + +### Changed +- The indent property of PEAR.Classes.ClassDeclaration has been removed + - Instead of calculating the indent of the brace, it just ensures the brace is aligned with the class keyword + - Other sniffs can be used to ensure the class itself is indented correctly +- Invalid exclude rules inside a ruleset.xml file are now ignored instead of potentially causing out of memory errors + - Using the -vv command line argument now also shows the invalid exclude rule as XML +- Includes all changes from the 2.8.1 release + +### Fixed +- Fixed bug #1333 : The new autoloader breaks some frameworks with custom autoloaders +- Fixed bug #1334 : Undefined offset when explaining standard with custom sniffs + +## [3.0.0RC3] - 2017-02-02 +### Changed +- Added support for ES6 class declarations + - Previously, these class were tokenized as JS objects but are now tokenized as normal T_CLASS structures +- Added support for ES6 method declarations, where the "function" keyword is not used + - Previously, these methods were tokenized as JS objects (fixes bug #1251) + - The name of the ES6 method is now assigned the T_FUNCTION keyword and treated like a normal function + - Custom sniffs that support JS and listen for T_FUNCTION tokens can't assume the token represents the word "function" + - Check the contents of the token first, or use $phpcsFile->getDeclarationName($stackPtr) if you just want its name + - There is no change for custom sniffs that only check PHP code +- PHPCBF exit codes have been changed so they are now more useful (request #1270) + - Exit code 0 is now used to indicate that no fixable errors were found, and so nothing was fixed + - Exit code 1 is now used to indicate that all fixable errors were fixed correctly + - Exit code 2 is now used to indicate that PHPCBF failed to fix some of the fixable errors it found + - Exit code 3 is now used for general script execution errors +- Added PEAR.Commenting.FileComment.ParamCommentAlignment to check alignment of multi-line param comments +- Includes all changes from the 2.8.0 release + +### Fixed +- Fixed an issue where excluding a file using a @codingStandardsIgnoreFile comment would produce errors + - For PHPCS, it would show empty files being processed + - For PHPCBF, it would produce a PHP error +- Fixed bug #1233 : Can't set config data inside ruleset.xml file +- Fixed bug #1241 : CodeSniffer.conf not working with 3.x PHAR file + +## [3.0.0RC2] - 2016-11-30 +### Changed +- Made the Runner class easier to use with wrapper scripts +- Full usage information is no longer printed when a usage error is encountered (request #1186) + - Makes it a lot easier to find and read the error message that was printed +- Includes all changes from the 2.7.1 release + +### Fixed +- Fixed an undefined var name error that could be produced while running PHPCBF +- Fixed bug #1167 : 3.0.0RC1 PHAR does not work with PEAR standard +- Fixed bug #1208 : Excluding files doesn't work when using STDIN with a filename specified + +## [3.0.0RC1] - 2016-09-02 +### Changed +- Progress output now shows E and W in green when a file has fixable errors or warnings + - Only supported if colors are enabled +- PHPCBF no longer produces verbose output by default (request #699) + - Use the -v command line argument to show verbose fixing output + - Use the -q command line argument to disable verbose information if enabled by default +- PHPBF now prints a summary report after fixing files + - Report shows files that were fixed, how many errors were fixed, and how many remain +- PHPCBF now supports the -p command line argument to print progress information + - Prints a green F for files where fixes occurred + - Prints a red E for files that could not be fixed due to an error + - Use the -q command line argument to disable progress information if enabled by default +- Running unit tests using --verbose no longer throws errors +- Includes all changes from the 2.7.0 release + +### Fixed +- Fixed shell error appearing on some systems when trying to find executable paths + +## [3.0.0a1] - 2016-07-20 +### Changed +- Min PHP version increased from 5.1.2 to 5.4.0 +- Added optional caching of results between runs (request #530) + - Enable the cache by using the --cache command line argument + - If you want the cache file written somewhere specific, use --cache=/path/to/cacheFile + - Use the command "phpcs --config-set cache true" to turn caching on by default + - Use the --no-cache command line argument to disable caching if it is being turned on automatically +- Add support for checking file in parallel (request #421) + - Tell PHPCS how many files to check at once using the --parallel command line argument + - To check 100 files at once, using --parallel=100 + - To disable parallel checking if it is being turned on automatically, use --parallel=1 + - Requires PHP to be compiled with the PCNTL package +- The default encoding has been changed from iso-8859-1 to utf-8 (request #760) + - The --encoding command line argument still works, but you no longer have to set it to process files as utf-8 + - If encoding is being set to utf-8 in a ruleset or on the CLI, it can be safely removed + - If the iconv PHP extension is not installed, standard non-multibyte aware functions will be used +- Added a new "code" report type to show a code snippet for each error (request #419) + - The line containing the error is printed, along with 2 lines above and below it to show context + - The location of the errors is underlined in the code snippet if you also use --colors + - Use --report=code to generate this report +- Added support for custom filtering of the file list + - Developers can write their own filter classes to perform custom filtering of the list before the run starts + - Use the command line arg --filter=/path/to/filter.php to specify a filter to use + - Extend \PHP_CodeSniffer\Filters\Filter to also support the core PHPCS extension and path filtering + - Extend \PHP_CodeSniffer\Filters\ExactMatch to get the core filtering and the ability to use blacklists and whitelists + - The included \PHP_CodeSniffer\Filters\GitModified filter is a good example of an ExactMatch filter +- Added support for only checking files that have been locally modified or added in a git repo + - Use --filter=gitmodified to check these files + - You still need to give PHPCS a list of files or directories in which to check +- Added automatic discovery of executable paths (request #571) + - Thanks to Sergey Morozov for the patch +- You must now pass "-" on the command line to have PHPCS wait for STDIN + - E.g., phpcs --standard=PSR2 - + - You can still pipe content via STDIN as normal as PHPCS will see this and process it + - But without the "-", PHPCS will throw an error if no content or files are passed to it +- All PHP errors generated by sniffs are caught, re-thrown as exceptions, and reported in the standard error reports + - This should stop bugs inside sniffs causing infinite loops + - Also stops invalid reports being produced as errors don't print to the screen directly +- Sniff codes are no longer optional + - If a sniff throws and error or a warning, it must specify an internal code for that message +- The installed_paths config setting can now point directly to a standard + - Previously, it had to always point to the directory in which the standard lives +- Multiple reports can now be specified using the --report command line argument + - Report types are separated by commas + - E.g., --report=full,summary,info + - Previously, you had to use one argument for each report such as --report=full --report=summary --report=info +- You can now set the severity, message type, and exclude patterns for and entire sniff, category, or standard + - Previously, this was only available for a single message +- You can now include a single sniff code in a ruleset instead of having to include an entire sniff + - Including a sniff code will automatically exclude all other messages from that sniff + - If the sniff is already included by an imported standard, set the sniff severity to 0 and include the specific message you want +- PHPCBF no longer uses patch + - Files are now always overwritten + - The --no-patch option has been removed +- Added a --basepath option to strip a directory from the front of file paths in output (request #470) + - The basepath is absolute or relative to the current directory + - E.g., to output paths relative to current dir in reports, use --basepath=. +- Ignore rules are now checked when using STDIN (request #733) +- Added an include-pattern tag to rulesets to include a sniff for specific files and folders only (request #656) + - This is the exact opposite of the exclude-pattern tag + - This option is only usable within sniffs, not globally like exclude-patterns are +- Added a new -m option to stop error messages from being recorded, which saves a lot of memory + - PHPCBF always uses this setting to reduce memory as it never outputs error messages + - Setting the $recordErrors member var inside custom report classes is no longer supported (use -m instead) +- Exit code 2 is now used to indicate fixable errors were found (request #930) + - Exit code 3 is now used for general script execution errors + - Exit code 1 is used to indicate that coding standard errors were found, but none are fixable + - Exit code 0 is unchanged and continues to mean no coding standard errors found + +### Removed +- The included PHPCS standard has been removed + - All rules are now found inside the phpcs.xml.dist file + - Running "phpcs" without any arguments from a git clone will use this ruleset +- The included SVN pre-commit hook has been removed + - Hooks for version control systems will no longer be maintained within the PHPCS project + +## [2.9.0] - 2017-05-04 +### Changed +- Added Generic.Debug.ESLint sniff to run ESLint over JS files and report errors + - Set eslint path using: phpcs --config-set eslint_path /path/to/eslint + - Thanks to Ryan McCue for the contribution +- T_POW is now properly considered an arithmetic operator, and will be checked as such + - Thanks to Juliette Reinders Folmer for the patch +- T_SPACESHIP and T_COALESCE are now properly considered comparison operators, and will be checked as such + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHP.DisallowShortOpenTag now warns about possible short open tags even when short_open_tag is set to OFF + - Thanks to Juliette Reinders Folmer for the patch +- Generic.WhiteSpace.DisallowTabIndent now finds and fixes improper use of spaces anywhere inside the line indent + - Previously, only the first part of the indent was used to determine the indent type + - Thanks to Juliette Reinders Folmer for the patch +- PEAR.Commenting.ClassComment now supports checking of traits as well as classes and interfaces + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.FunctionCommentThrowTag now supports re-throwing exceptions (request #946) + - Thanks to Samuel Levy for the patch +- Squiz.PHP.DisallowMultipleAssignments now ignores PHP4-style member var assignments + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.FunctionSpacing now ignores spacing above functions when they are preceded by inline comments + - Stops conflicts between this sniff and comment spacing sniffs +- Squiz.WhiteSpace.OperatorSpacing no longer checks the equal sign in declare statements + - Thanks to Juliette Reinders Folmer for the patch +- Added missing error codes for a couple of sniffs so they can now be customised as normal + +### Fixed +- Fixed bug #1266 : PEAR.WhiteSpace.ScopeClosingBrace can throw an error while fixing mixed PHP/HTML +- Fixed bug #1364 : Yield From values are not recognised as returned values in Squiz FunctionComment sniff +- Fixed bug #1373 : Error in tab expansion results in white-space of incorrect size + - Thanks to Mark Clements for the patch +- Fixed bug #1381 : Tokenizer: dereferencing incorrectly identified as short array +- Fixed bug #1387 : Squiz.ControlStructures.ControlSignature does not handle alt syntax when checking space after closing brace +- Fixed bug #1392 : Scope indent calculated incorrectly when using array destructuring +- Fixed bug #1394 : integer type hints appearing as TypeHintMissing instead of ScalarTypeHintMissing + - PHP 7 type hints were also being shown when run under PHP 5 in some cases +- Fixed bug #1405 : Squiz.WhiteSpace.ScopeClosingBrace fails to fix closing brace within indented PHP tags +- Fixed bug #1421 : Ternaries used in constant scalar expression for param default misidentified by tokenizer +- Fixed bug #1431 : PHPCBF can't fix short open tags when they are not followed by a space + - Thanks to Gonçalo Queirós for the patch +- Fixed bug #1432 : PHPCBF can make invalid fixes to inline JS control structures that make use of JS objects + +## [2.8.1] - 2017-03-02 +### Security +- This release contains a fix for a security advisory related to the improper handling of shell commands + - Uses of shell_exec() and exec() were not escaping filenames and configuration settings in most cases + - A properly crafted filename or configuration option would allow for arbitrary code execution when using some features + - All users are encouraged to upgrade to this version, especially if you are checking 3rd-party code + - e.g., you run PHPCS over libraries that you did not write + - e.g., you provide a web service that runs PHPCS over user-uploaded files or 3rd-party repositories + - e.g., you allow external tool paths to be set by user-defined values + - If you are unable to upgrade but you check 3rd-party code, ensure you are not using the following features: + - The diff report + - The notify-send report + - The Generic.PHP.Syntax sniff + - The Generic.Debug.CSSLint sniff + - The Generic.Debug.ClosureLinter sniff + - The Generic.Debug.JSHint sniff + - The Squiz.Debug.JSLint sniff + - The Squiz.Debug.JavaScriptLint sniff + - The Zend.Debug.CodeAnalyzer sniff + - Thanks to Klaus Purer for the report + +### Changed +- The PHP-supplied T_COALESCE_EQUAL token has been replicated for PHP versions before 7.2 +- PEAR.Functions.FunctionDeclaration now reports an error for blank lines found inside a function declaration +- PEAR.Functions.FunctionDeclaration no longer reports indent errors for blank lines in a function declaration +- Squiz.Functions.MultiLineFunctionDeclaration no longer reports errors for blank lines in a function declaration + - It would previously report that only one argument is allowed per line +- Squiz.Commenting.FunctionComment now corrects multi-line param comment padding more accurately +- Squiz.Commenting.FunctionComment now properly fixes pipe-separated param types +- Squiz.Commenting.FunctionComment now works correctly when function return types also contain a comment + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.ControlStructures.InlineIfDeclaration now supports the elvis operator + - As this is not a real PHP operator, it enforces no spaces between ? and : when the THEN statement is empty +- Squiz.ControlStructures.InlineIfDeclaration is now able to fix the spacing errors it reports + +### Fixed +- Fixed bug #1340 : STDIN file contents not being populated in some cases + - Thanks to David Biňovec for the patch +- Fixed bug #1344 : PEAR.Functions.FunctionCallSignatureSniff throws error for blank comment lines +- Fixed bug #1347 : PSR2.Methods.FunctionCallSignature strips some comments during fixing + - Thanks to Algirdas Gurevicius for the patch +- Fixed bug #1349 : Squiz.Strings.DoubleQuoteUsage.NotRequired message is badly formatted when string contains a CR newline char + - Thanks to Algirdas Gurevicius for the patch +- Fixed bug #1350 : Invalid Squiz.Formatting.OperatorBracket error when using namespaces +- Fixed bug #1369 : Empty line in multi-line function declaration cause infinite loop + +## [2.8.0] - 2017-02-02 +### Changed +- The Internal.NoCodeFound error is no longer generated for content sourced from STDIN + - This should stop some Git hooks generating errors because PHPCS is trying to process the refs passed on STDIN +- Squiz.Commenting.DocCommentAlignment now checks comments on class properties defined using the VAR keyword + - Thanks to Klaus Purer for the patch +- The getMethodParameters() method now recognises "self" as a valid type hint + - The return array now contains a new "content" index containing the raw content of the param definition + - Thanks to Juliette Reinders Folmer for the patch +- The getMethodParameters() method now supports nullable types + - The return array now contains a new "nullable_type" index set to true or false for each method param + - Thanks to Juliette Reinders Folmer for the patch +- The getMethodParameters() method now supports closures + - Thanks to Juliette Reinders Folmer for the patch +- Added more guard code for JS files with syntax errors (request #1271 and request #1272) +- Added more guard code for CSS files with syntax errors (request #1304) +- PEAR.Commenting.FunctionComment fixers now correctly handle multi-line param comments +- AbstractVariableSniff now supports anonymous classes + - Thanks to Juliette Reinders Folmer for the patch +- Generic.NamingConventions.ConstructorName and PEAR.NamingConventions.ValidVariable now support anonymous classes +- Generic.NamingConventions.CamelCapsFunctionName and PEAR.NamingConventions.ValidFunctionName now support anonymous classes + - Thanks to Juliette Reinders Folmer for the patch +- Generic.CodeAnalysis.UnusedFunctionParameter and PEAR.Functions.ValidDefaultValue now support closures + - Thanks to Juliette Reinders Folmer for the patch +- PEAR.NamingConventions.ValidClassName and Squiz.Classes.ValidClassName now support traits + - Thanks to Juliette Reinders Folmer for the patch +- Generic.Functions.FunctionCallArgumentSpacing now supports closures other PHP-provided functions + - Thanks to Algirdas Gurevicius for the patch +- Fixed an error where a nullable type character was detected as an inline then token + - A new T_NULLABLE token has been added to represent the ? nullable type character + - Thanks to Jaroslav Hanslík for the patch +- Squiz.WhiteSpace.SemicolonSpacing no longer removes comments while fixing the placement of semicolons + - Thanks to Algirdas Gurevicius for the patch + +### Fixed +- Fixed bug #1230 : JS tokeniser incorrectly tokenises bitwise shifts as comparison + - Thanks to Ryan McCue for the patch +- Fixed bug #1237 : Uninitialized string offset in PHP Tokenizer on PHP 5.2 +- Fixed bug #1239 : Warning when static method name is 'default' +- Fixed bug #1240 : False positive for function names starting with triple underscore + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1245 : SELF is not recognised as T_SELF token in: return new self +- Fixed bug #1246 : A mix of USE statements with and without braces can cause the tokenizer to mismatch brace tokens + - Thanks to Michał Bundyra for the patch +- Fixed bug #1249 : GitBlame report requires a .git directory +- Fixed bug #1252 : Squiz.Strings.ConcatenationSpacing fix creates syntax error when joining a number to a string +- Fixed bug #1253 : Generic.ControlStructures.InlineControlStructure fix creates syntax error fixing if-try/catch +- Fixed bug #1255 : Inconsistent indentation check results when ELSE on new line +- Fixed bug #1257 : Double dash in CSS class name can lead to "Named colours are forbidden" false positives +- Fixed bug #1260 : Syntax errors not being shown when error_prepend_string is set + - Thanks to Juliette Reinders Folmer for the patch +- Fixed bug #1264 : Array return type hint is sometimes detected as T_ARRAY_HINT instead of T_RETURN_TYPE + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #1265 : ES6 arrow function raises unexpected operator spacing errors +- Fixed bug #1267 : Fixer incorrectly handles filepaths with repeated dir names + - Thanks to Sergey Ovchinnikov for the patch +- Fixed bug #1276 : Commenting.FunctionComment.InvalidReturnVoid conditional issue with anonymous classes +- Fixed bug #1277 : Squiz.PHP.DisallowMultipleAssignments.Found error when var assignment is on the same line as an open tag +- Fixed bug #1284 : Squiz.Arrays.ArrayBracketSpacing.SpaceBeforeBracket false positive match for short list syntax + +## [2.7.1] - 2016-11-30 +### Changed +- Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis fix now removes unnecessary whitespace +- Squiz.Formatting.OperatorBracket no longer errors for negative array indexes used within a function call +- Squiz.PHP.EmbeddedPhp no longer expects a semicolon after statements that are only opening a scope +- Fixed a problem where the content of T_DOC_COMMENT_CLOSE_TAG tokens could sometimes be (boolean) false +- Developers of custom standards with custom test runners can now have their standards ignored by the built-in test runner + - Set the value of an environment variable called PHPCS_IGNORE_TESTS with a comma separated list of your standard names + - Thanks to Juliette Reinders Folmer for the patch +- The unit test runner now loads the test sniff outside of the standard's ruleset so that exclude rules do not get applied + - This may have caused problems when testing custom sniffs inside custom standards + - Also makes the unit tests runs a little faster +- The SVN pre-commit hook now works correctly when installed via composer + - Thanks to Sergey for the patch + +### Fixed +- Fixed bug #1135 : PEAR.ControlStructures.MultiLineCondition.CloseBracketNewLine not detected if preceded by multiline function call +- Fixed bug #1138 : PEAR.ControlStructures.MultiLineCondition.Alignment not detected if closing brace is first token on line +- Fixed bug #1141 : Sniffs that check EOF newlines don't detect newlines properly when the last token is a doc block +- Fixed bug #1150 : Squiz.Strings.EchoedStrings does not properly fix bracketed statements +- Fixed bug #1156 : Generic.Formatting.DisallowMultipleStatements errors when multiple short echo tags are used on the same line + - Thanks to Nikola Kovacs for the patch +- Fixed bug #1161 : Absolute report path is treated like a relative path if it also exists within the current directory +- Fixed bug #1170 : Javascript regular expression literal not recognized after comparison operator +- Fixed bug #1180 : Class constant named FUNCTION is incorrectly tokenized +- Fixed bug #1181 : Squiz.Operators.IncrementDecrementUsage.NoBrackets false positive when incrementing properties + - Thanks to Jürgen Henge-Ernst for the patch +- Fixed bug #1188 : Generic.WhiteSpace.ScopeIndent issues with inline HTML and multi-line function signatures +- Fixed bug #1190 : phpcbf on if/else with trailing comment generates erroneous code +- Fixed bug #1191 : Javascript sniffer fails with function called "Function" +- Fixed bug #1203 : Inconsistent behavior of PHP_CodeSniffer_File::findEndOfStatement +- Fixed bug #1218 : CASE conditions using class constants named NAMESPACE/INTERFACE/TRAIT etc are incorrectly tokenized +- Fixed bug #1221 : Indented function call with multiple closure arguments can cause scope indent error +- Fixed bug #1224 : PHPCBF fails to fix code with heredoc/nowdoc as first argument to a function + +## [2.7.0] - 2016-09-02 +### Changed +- Added --file-list command line argument to allow a list of files and directories to be specified in an external file + - Useful is you have a generated list of files to check that would be too long for the command line + - File and directory paths are listed one per line + - Usage is: phpcs --file-list=/path/to/file-list ... + - Thanks to Blotzu for the patch +- Values set using @codingStandardsChangeSetting comments can now contain spaces +- Sniff unit tests can now specify a list of test files instead of letting the runner pick them (request #1078) + - Useful if a sniff needs to exclude files based on the environment, or is checking filenames + - Override the new getTestFiles() method to specify your own list of test files +- Generic.Functions.OpeningFunctionBraceKernighanRitchie now ignores spacing for function return types + - The sniff code Generic.Functions.OpeningFunctionBraceKernighanRitchie.SpaceAfterBracket has been removed + - Replaced by Generic.Functions.OpeningFunctionBraceKernighanRitchie.SpaceBeforeBrace + - The new error message is slightly clearer as it indicates that a single space is needed before the brace +- Squiz.Commenting.LongConditionClosingComment now allows for the length of a code block to be configured + - Set the lineLimit property (default is 20) in your ruleset.xml file to set the code block length + - When the code block length is reached, the sniff will enforce a closing comment after the closing brace + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.Commenting.LongConditionClosingComment now allows for the end comment format to be configured + - Set the commentFormat property (default is "//end %s") in your ruleset.xml file to set the format + - The placeholder %s will be replaced with the type of condition opener, e.g., "//end foreach" + - Thanks to Juliette Reinders Folmer for the patch +- Generic.PHPForbiddenFunctions now allows forbidden functions to have mixed case + - Previously, it would only do a strtolower comparison + - Error message now shows what case was found in the code and what the correct case should be + - Thanks to Juliette Reinders Folmer for the patch +- Added Generic.Classes.OpeningBraceSameLine to ensure opening brace of class/interface/trait is on the same line as the declaration + - Thanks to Juliette Reinders Folmer for the patch +- Added Generic.PHP.BacktickOperator to ban the use of the backtick operator for running shell commands + - Thanks to Juliette Reinders Folmer for the patch +- Added Generic.PHP.DisallowAlternativePHPTags to ban the use of alternate PHP tags + - Thanks to Juliette Reinders Folmer for the patch +- Squiz.WhiteSpace.LanguageConstructSpacing no longer checks for spaces if parenthesis are being used (request #1062) + - Makes this sniff more compatible with those that check parenthesis spacing of function calls +- Squiz.WhiteSpace.ObjectOperatorSpacing now has a setting to ignore newline characters around object operators + - Default remains FALSE, so newlines are not allowed + - Override the "ignoreNewlines" setting in a ruleset.xml file to change + - Thanks to Alex Howansky for the patch +- Squiz.Scope.MethodScope now sniffs traits as well as classes and interfaces + - Thanks to Jesse Donat for the patch +- PHPCBF is now able to fix Squiz.SelfMemberReference.IncorrectCase errors + - Thanks to Nikola Kovacs for the patch +- PHPCBF is now able to fix Squiz.Commenting.VariableComment.IncorrectVarType + - Thanks to Walt Sorensen for the patch +- PHPCBF is now able to fix Generic.PHP.DisallowShortOpenTag + - Thanks to Juliette Reinders Folmer for the patch +- Improved the formatting of the end brace when auto fixing InlineControlStructure errors (request #1121) +- Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine fix no longer leaves blank line after brace (request #1085) +- Generic UpperCaseConstantNameSniff now allows lowercase namespaces in constant definitions + - Thanks to Daniel Schniepp for the patch +- Squiz DoubleQuoteUsageSniff is now more tolerant of syntax errors caused by mismatched string tokens +- A few sniffs that produce errors based on the current PHP version can now be told to run using a specific PHP version + - Set the php_version config var using --config-set, --runtime-set, or in a ruleset to specify a specific PHP version + - The format of the PHP version is the same as the PHP_VERSION_ID constant (e.g., 50403 for version 5.4.3) + - Supported sniffs are Generic.PHP.DisallowAlternativePHPTags, PSR1.Classes.ClassDeclaration, Squiz.Commenting.FunctionComment + - Thanks to Finlay Beaton for the patch + +### Fixed +- Fixed bug #985 : Duplicate class definition detection generates false-positives in media queries + - Thanks to Raphael Horber for the patch +- Fixed bug #1014 : Squiz VariableCommentSniff doesn't always detect a missing comment +- Fixed bug #1066 : Undefined index: quiet in CLI.php during unit test run with -v command line arg +- Fixed bug #1072 : Squiz.SelfMemberReference.NotUsed not detected if leading namespace separator is used +- Fixed bug #1089 : Rulesets cannot be loaded if the path contains urlencoded characters +- Fixed bug #1091 : PEAR and Squiz FunctionComment sniffs throw errors for some invalid @param line formats +- Fixed bug #1092 : PEAR.Functions.ValidDefaultValue should not flag type hinted methods with a NULL default argument +- Fixed bug #1095 : Generic LineEndings sniff replaces tabs with spaces with --tab-width is set +- Fixed bug #1096 : Squiz FunctionDeclarationArgumentSpacing gives incorrect error/fix when variadic operator is followed by a space +- Fixed bug #1099 : Group use declarations are incorrectly fixed by the PSR2 standard + - Thanks to Jason McCreary for the patch +- Fixed bug #1101 : Incorrect indent errors when breaking out of PHP inside an IF statement +- Fixed bug #1102 : Squiz.Formatting.OperatorBracket.MissingBrackets faulty bracketing fix +- Fixed bug #1109 : Wrong scope indent reported in anonymous class +- Fixed bug #1112 : File docblock not recognized when require_once follows it +- Fixed bug #1120 : InlineControlStructureSniff does not handle auto-fixing for control structures that make function calls +- Fixed bug #1124 : Squiz.Operators.ComparisonOperatorUsage does not detect bracketed conditions for inline IF statements + - Thanks to Raphael Horber for the patch + +## [2.6.2] - 2016-07-14 +### Changed +- Added a new --exclude CLI argument to exclude a list of sniffs from checking and fixing (request #904) + - Accepts the same sniff codes as the --sniffs command line argument, but provides the opposite functionality +- Added a new -q command line argument to disable progress and verbose information from being printed (request #969) + - Useful if a coding standard hard-codes progress or verbose output but you want PHPCS to be quiet + - Use the command "phpcs --config-set quiet true" to turn quiet mode on by default +- Generic LineLength sniff no longer errors for comments that cannot be broken out onto a new line (request #766) + - A typical case is a comment that contains a very long URL + - The comment is ignored if putting the URL on a indented new comment line would be longer than the allowed length +- Settings extensions in a ruleset no longer causes PHP notices during unit testing + - Thanks to Klaus Purer for the patch +- Version control reports now show which errors are fixable if you are showing sources +- Added a new sniff to enforce a single space after a NOT operator (request #1051) + - Include in a ruleset using the code Generic.Formatting.SpaceAfterNot +- The Squiz.Commenting.BlockComment sniff now supports tabs for indenting comment lines (request #1056) + +### Fixed +- Fixed bug #790 : Incorrect missing @throws error in methods that use closures +- Fixed bug #908 : PSR2 standard is not checking that closing brace is on line following the body +- Fixed bug #945 : Incorrect indent behavior using deep-nested function and arrays +- Fixed bug #961 : Two anonymous functions passed as function/method arguments cause indentation false positive +- Fixed bug #1005 : Using global composer vendor autoload breaks PHP lowercase built-in function sniff + - Thanks to Michael Butler for the patch +- Fixed bug #1007 : Squiz Unreachable code detection is not working properly with a closure inside a case +- Fixed bug #1023 : PSR2.Classes.ClassDeclaration fails if class extends base class and "implements" is on trailing line +- Fixed bug #1026 : Arrays in comma delimited class properties cause ScopeIndent to increase indent +- Fixed bug #1028 : Squiz ArrayDeclaration incorrectly fixes multi-line array where end bracket is not on a new line +- Fixed bug #1034 : Squiz FunctionDeclarationArgumentSpacing gives incorrect error when first arg is a variadic +- Fixed bug #1036 : Adjacent assignments aligned analysis statement wrong +- Fixed bug #1049 : Version control reports can show notices when the report width is very small +- Fixed bug #21050 : PEAR MultiLineCondition sniff suppresses errors on last condition line + +## [2.6.1] - 2016-05-31 +### Changed +- The PHP-supplied T_COALESCE token has been replicated for PHP versions before 7.0 +- Function return types of self, parent and callable are now tokenized as T_RETURN_TYPE + - Thanks to Jaroslav Hanslík for the patch +- The default_standard config setting now allows multiple standards to be listed, like on the command line + - Thanks to Michael Mayer for the patch +- Installations done via composer now only include the composer autoloader for PHP 5.3.2+ (request #942) +- Added a rollbackChangeset() method to the Fixer class to purposely rollback the active changeset + +### Fixed +- Fixed bug #940 : Auto-fixing issue encountered with inconsistent use of braces +- Fixed bug #943 : Squiz.PHP.InnerFunctions.NotAllowed reported in anonymous classes +- Fixed bug #944 : PHP warning when running the latest phar +- Fixed bug #951 : InlineIfDeclaration: invalid error produced with UTF-8 string +- Fixed bug #957 : Operator spacing sniff errors when plus is used as part of a number + - Thanks to Klaus Purer for the patch +- Fixed bug #959 : Call-time pass-by-reference false positive if there is a square bracket before the ampersand + - Thanks to Konstantin Leboev for the patch +- Fixed bug #962 : Null coalescing operator (??) not detected as a token + - Thanks to Joel Posti for the patch +- Fixed bug #973 : Anonymous class declaration and PSR1.Files.SideEffects.FoundWithSymbols +- Fixed bug #974 : Error when file ends with "function" +- Fixed bug #979 : Anonymous function with return type hint is not refactored as expected +- Fixed bug #983 : Squiz.WhiteSpace.MemberVarSpacing.AfterComment fails to fix error when comment is not a docblock +- Fixed bug #1010 : Squiz NonExecutableCode sniff does not detect boolean OR + - Thanks to Derek Henderson for the patch +- Fixed bug #1015 : The Squiz.Commenting.FunctionComment sniff doesn't allow description in @return tag + - Thanks to Alexander Obuhovich for the patch +- Fixed bug #1022 : Duplicate spaces after opening bracket error with PSR2 standard +- Fixed bug #1025 : Syntax error in JS file can cause undefined index for parenthesis_closer + +## [2.6.0] - 2016-04-04 +### Changed +- Paths used when setting CLI arguments inside ruleset.xml files are now relative to the ruleset location (request #847) + - This change only applies to paths within ARG tags, used to set CLI arguments + - Previously, the paths were relative to the directory PHPCS was being run from + - Absolute paths are still allowed and work the same way they always have + - This change allows ruleset.xml files to be more portable +- Content passed via STDIN will now be processed even if files are specified on the command line or in a ruleset +- When passing content via STDIN, you can now specify the file path to use on the command line (request #934) + - This allows sniffs that check file paths to work correctly + - This is the same functionality provided by the phpcs_input_file line, except it is available on the command line +- Files processed with custom tokenizers will no longer be skipped if they appear minified (request #877) + - If the custom tokenizer wants minified files skipped, it can set a $skipMinified member var to TRUE + - See the included JS and CSS tokenizers for an example +- Config vars set in ruleset.xml files are now processed earlier, allowing them to be used during sniff registration + - Among other things, this allows the installed_paths config var to be set in ruleset.xml files + - Thanks to Pieter Frenssen for the patch +- Improved detection of regular expressions in the JS tokenizer +- Generic PHP Syntax sniff now uses PHP_BINARY (if available) to determine the path to PHP if no other path is available + - You can still manually set php_path to use a specific binary for testing + - Thanks to Andrew Berry for the patch +- The PHP-supplied T_POW_EQUAL token has been replicated for PHP versions before 5.6 +- Added support for PHP7 use group declarations (request #878) + - New tokens T_OPEN_USE_GROUP and T_CLOSE_USE_GROUP are assigned to the open and close curly braces +- Generic ScopeIndent sniff now reports errors for every line that needs the indent changed (request #903) + - Previously, it ignored lines that were indented correctly in the context of their block + - This change produces more technically accurate error messages, but is much more verbose +- The PSR2 and Squiz standards now allow multi-line default values in function declarations (request #542) + - Previously, these would automatically make the function a multi-line declaration +- Squiz InlineCommentSniff now allows docblocks on require(_once) and include(_once) statements + - Thanks to Gary Jones for the patch +- Squiz and PEAR Class and File sniffs no longer assume the first comment in a file is always a file comment + - phpDocumentor assigns the comment to the file only if it is not followed by a structural element + - These sniffs now follow this same rule +- Squiz ClassCommentSniff no longer checks for blank lines before class comments + - Removes the error Squiz.Commenting.ClassComment.SpaceBefore +- Renamed Squiz.CSS.Opacity.SpacingAfterPoint to Squiz.CSS.Opacity.DecimalPrecision + - Please update your ruleset if you are referencing this error code directly +- Fixed PHP tokenizer problem that caused an infinite loop when checking a comment with specific content +- Generic Disallow Space and Tab indent sniffs now detect and fix indents inside embedded HTML chunks (request #882) +- Squiz CSS IndentationSniff no longer assumes the class opening brace is at the end of a line +- Squiz FunctionCommentThrowTagSniff now ignores non-docblock comments +- Squiz ComparisonOperatorUsageSniff now allows conditions like while(true) +- PEAR FunctionCallSignatureSniff (and the Squiz and PSR2 sniffs that use it) now correctly check the first argument + - Further fix for bug #698 + +### Fixed +- Fixed bug #791 : codingStandardsChangeSetting settings not working with namespaces +- Fixed bug #872 : Incorrect detection of blank lines between CSS class names +- Fixed bug #879 : Generic InlineControlStructureSniff can create parse error when case/if/elseif/else have mixed brace and braceless definitions +- Fixed bug #883 : PSR2 is not checking for blank lines at the start and end of control structures +- Fixed bug #884 : Incorrect indentation notice for anonymous classes +- Fixed bug #887 : Using curly braces for a shared CASE/DEFAULT statement can generate an error in PSR2 SwitchDeclaration +- Fixed bug #889 : Closure inside catch/else/elseif causes indentation error +- Fixed bug #890 : Function call inside returned short array value can cause indentation error inside CASE statements +- Fixed bug #897 : Generic.Functions.CallTimePassByReference.NotAllowed false positive when short array syntax +- Fixed bug #900 : Squiz.Functions.FunctionDeclarationArgumentSpacing bug when no space between type hint and argument +- Fixed bug #902 : T_OR_EQUAL and T_POW_EQUAL are not seen as assignment tokens +- Fixed bug #910 : Unrecognized "extends" and indentation on anonymous classes +- Fixed bug #915 : JS Tokenizer generates errors when processing some decimals +- Fixed bug #928 : Endless loop when sniffing a PHP file with a git merge conflict inside a function +- Fixed bug #937 : Shebang can cause PSR1 SideEffects warning + - Thanks to Clay Loveless for the patch +- Fixed bug #938 : CallTimePassByReferenceSniff ignores functions with return value + +## [2.5.1] - 2016-01-20 +### Changed +- The PHP-supplied T_SPACESHIP token has been replicated for PHP versions before 7.0 +- T_SPACESHIP is now correctly identified as an operator + - Thanks to Alexander Obuhovich for the patch +- Generic LowerCaseKeyword now ensures array type hints are lowercase as well + - Thanks to Mathieu Rochette for the patch +- Squiz ComparisonOperatorUsageSniff no longer hangs on JS FOR loops that don't use semicolons +- PHP_CodesSniffer now includes the composer autoload.php file, if there is one + - Thanks to Klaus Purer for the patch +- Added error Squiz.Commenting.FunctionComment.ScalarTypeHintMissing for PHP7 only (request #858) + - These errors were previously reported as Squiz.Commenting.FunctionComment.TypeHintMissing on PHP7 + - Disable this error message in a ruleset.xml file if your code needs to run on both PHP5 and PHP7 +- The PHP 5.6 __debugInfo magic method no longer produces naming convention errors + - Thanks to Michael Nowack for the patch +- PEAR and Squiz FunctionComment sniffs now support variadic functions (request #841) + +### Fixed +- Fixed bug #622 : Wrong detection of Squiz.CSS.DuplicateStyleDefinition with media queries +- Fixed bug #752 : The missing exception error is reported in first found DocBlock +- Fixed bug #794 : PSR2 MultiLineFunctionDeclaration forbids comments after opening parenthesis of a multiline call +- Fixed bug #820 : PEAR/PSR2 FunctionCallSignature sniffs suggest wrong indent when there are multiple arguments on a line +- Fixed bug #822 : Ruleset hard-coded file paths are not used if not running from the same directory as the ruleset +- Fixed bug #825 : FunctionCallArgumentSpacing sniff complains about more than one space before comment in multi-line function call +- Fixed bug #828 : Null classname is tokenized as T_NULL instead of T_STRING +- Fixed bug #829 : Short array argument not fixed correctly when multiple function arguments are on the same line +- Fixed bug #831 : PHPCS freezes in an infinite loop under Windows if no standard is passed +- Fixed bug #832 : Tokenizer does not support context sensitive parsing + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #835 : PEAR.Functions.FunctionCallSignature broken when closure uses return types +- Fixed bug #838 : CSS indentation fixer changes color codes + - Thanks to Klaus Purer for the patch +- Fixed bug #839 : "__()" method is marked as not camel caps + - Thanks to Tim Bezhashvyly for the patch +- Fixed bug #852 : Generic.Commenting.DocComment not finding errors when long description is omitted +- Fixed bug #854 : Return typehints in interfaces are not reported as T_RETURN_TYPE + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #855 : Capital letter detection for multibyte strings doesn't work correctly +- Fixed bug #857 : PSR2.ControlStructure.SwitchDeclaration shouldn't check indent of curly brace closers +- Fixed bug #859 : Switch statement indention issue when returning function call with closure +- Fixed bug #861 : Single-line arrays and function calls can generate incorrect indentation errors +- Fixed bug #867 : Squiz.Strings.DoubleQuoteUsage broken for some escape codes + - Thanks to Jack Blower for the help with the fix +- Fixed bug #21005 : Incorrect indent detection when multiple properties are initialized to arrays +- Fixed bug #21010 : Incorrect missing colon detection in CSS when first style is not on new line +- Fixed bug #21011 : Incorrect error message text when newline found after opening brace + +## [2.5.0] - 2015-12-11 +### Changed +- PHPCS will now look for a phpcs.xml file in parent directories as well as the current directory (request #626) +- PHPCS will now use a phpcs.xml file even if files are specified on the command line + - This file is still only used if no standard is specified on the command line +- Added support for a phpcs.xml.dist file (request #583) + - If both a phpcs.xml and phpcs.xml.dist file are present, the phpcs.xml file will be used +- Added support for setting PHP ini values in ruleset.xml files (request #560) + - Setting the value of the new ini tags to name="memory_limit" value="32M" is the same as -d memory_limit=32M +- Added support for one or more bootstrap files to be run before processing begins + - Use the --bootstrap=file,file,file command line argument to include bootstrap files + - Useful if you want to override some of the high-level settings of PHPCS or PHPCBF + - Thanks to John Maguire for the patch +- Added additional verbose output for CSS tokenizing +- Squiz ComparisonOperatorUsageSniff now checks FOR, WHILE and DO-WHILE statements + - Thanks to Arnout Boks for the patch + +### Fixed +- Fixed bug #660 : Syntax checks can fail on Windows with PHP5.6 +- Fixed bug #784 : $this->trait is seen as a T_TRAIT token +- Fixed bug #786 : Switch indent issue with short array notation +- Fixed bug #787 : SpacingAfterDefaultBreak confused by multi-line statements +- Fixed bug #797 : Parsing CSS url() value breaks further parsing +- Fixed bug #805 : Squiz.Commenting.FunctionComment.InvalidTypeHint on Scalar types on PHP7 +- Fixed bug #807 : Cannot fix line endings when open PHP tag is not on the first line +- Fixed bug #808 : JS tokeniser incorrectly setting some function and class names to control structure tokens +- Fixed bug #809 : PHPCBF can break a require_once statement with a space before the open parenthesis +- Fixed bug #813 : PEAR FunctionCallSignature checks wrong indent when first token on line is part of a multi-line string + +## [2.4.0] - 2015-11-24 +### Changed +- Added support for PHP 7 anonymous classes + - Anonymous classes are now tokenized as T_ANON_CLASS and ignored by normal class sniffs +- Added support for PHP 7 function return type declarations + - Return types are now tokenized as T_RETURN_TYPE +- Fixed tokenizing of the XOR operator, which was incorrectly identified as a power operator (bug #765) + - The T_POWER token has been removed and replaced by the T_BITWISE_XOR token + - The PHP-supplied T_POW token has been replicated for PHP versions before 5.6 +- Traits are now tokenized in PHP versions before 5.4 to make testing easier +- Improved regular expression detection in JS files +- PEAR FunctionCallSignatureSniff now properly detects indents in more mixed HTML/PHP code blocks +- Full report now properly indents lines when newlines are found inside error messages +- Generating documentation without specifying a standard now uses the default standard instead + - Thanks to Ken Guest for the patch +- Generic InlineControlStructureSniff now supports braceless do/while loops in JS + - Thanks to Pieter Frenssen for the patch +- Added more guard code for function declarations with syntax errors + - Thanks to Yun Young-jin for the patch +- Added more guard code for foreach declarations with syntax errors + - Thanks to Johan de Ruijter for the patch +- Added more guard code for class declarations with syntax errors +- Squiz ArrayDeclarationSniff now has guard code for arrays with syntax errors +- Generic InlineControlStructureSniff now correctly fixes ELSEIF statements + +### Fixed +- Fixed bug #601 : Expected type hint int[]; found array in Squiz FunctionCommentSniff + - Thanks to Scato Eggen for the patch +- Fixed bug #625 : Consider working around T_HASHBANG in HHVM 3.5.x and 3.6.x + - Thanks to Kunal Mehta for the patch +- Fixed bug #692 : Comment tokenizer can break when using mbstring function overloading +- Fixed bug #694 : Long sniff codes can cause PHP warnings in source report when showing error codes +- Fixed bug #698 : PSR2.Methods.FunctionCallSignature.Indent forces exact indent of ternary operator parameters +- Fixed bug #704 : ScopeIndent can fail when an opening parenthesis is on a line by itself +- Fixed bug #707 : Squiz MethodScopeSniff doesn't handle nested functions +- Fixed bug #709 : Squiz.Sniffs.Whitespace.ScopeClosingBraceSniff marking indented endif in mixed inline HTML blocks +- Fixed bug #711 : Sniffing from STDIN shows Generic.Files.LowercasedFilename.NotFound error +- Fixed bug #714 : Fixes suppression of errors using docblocks + - Thanks to Andrzej Karmazyn for the patch +- Fixed bug #716 : JSON report is invalid when messages contain newlines or tabs + - Thanks to Pieter Frenssen for the patch +- Fixed bug #723 : ScopeIndent can fail when multiple array closers are on the same line +- Fixed bug #730 : ScopeIndent can fail when a short array opening square bracket is on a line by itself +- Fixed bug #732 : PHP Notice if @package name is made up of all invalid characters + - Adds new error code PEAR.Commenting.FileComment.InvalidPackageValue +- Fixed bug #748 : Auto fix for Squiz.Commenting.BlockComment.WrongEnd is incorrect + - Thanks to J.D. Grimes for the patch +- Fixed bug #753 : PSR2 standard shouldn't require space after USE block when next code is a closing tag +- Fixed bug #768 : PEAR FunctionCallSignature sniff forbids comments after opening parenthesis of a multiline call +- Fixed bug #769 : Incorrect detection of variable reference operator when used with short array syntax + - Thanks to Klaus Purer for the patch +- Fixed bug #772 : Syntax error when using PHPCBF on alternative style foreach loops +- Fixed bug #773 : Syntax error when stripping trailing PHP close tag and previous statement has no semicolon +- Fixed bug #778 : PHPCBF creates invalid PHP for inline FOREACH containing multiple control structures +- Fixed bug #781 : Incorrect checking for PHP7 return types on multi-line function declarations +- Fixed bug #782 : Conditional function declarations cause fixing conflicts in Squiz standard + - Squiz.ControlStructures.ControlSignature no longer enforces a single newline after open brace + - Squiz.WhiteSpace.ControlStructureSpacing can be used to check spacing at the start/end of control structures + +## [2.3.4] - 2015-09-09 +### Changed +- JSON report format now includes the fixable status for each error message and the total number of fixable errors +- Added more guard code for function declarations with syntax errors +- Added tokenizer support for the PHP declare construct + - Thanks to Andy Blyler for the patch +- Generic UnnecessaryStringConcatSniff can now allow strings concatenated over multiple lines + - Set the allowMultiline property to TRUE (default is FALSE) in your ruleset.xml file to enable this + - By default, concat used only for getting around line length limits still generates an error + - Thanks to Stefan Lenselink for the contribution +- Invalid byte sequences no longer throw iconv_strlen() errors (request #639) + - Thanks to Willem Stuursma for the patch +- Generic TodoSniff and FixmeSniff are now better at processing strings with invalid characters +- PEAR FunctionCallSignatureSniff now ignores indentation of inline HTML content +- Squiz ControlSignatureSniff now supports control structures with only inline HTML content + +### Fixed +- Fixed bug #636 : Some class names cause CSS tokenizer to hang +- Fixed bug #638 : VCS blame reports output error content from the blame commands for files not under VC +- Fixed bug #642 : Method params incorrectly detected when default value uses short array syntax + - Thanks to Josh Davis for the patch +- Fixed bug #644 : PEAR ScopeClosingBrace sniff does not work with mixed HTML/PHP +- Fixed bug #645 : FunctionSignature and ScopeIndent sniffs don't detect indents correctly when PHP open tag is not on a line by itself +- Fixed bug #648 : Namespace not tokenized correctly when followed by multiple use statements +- Fixed bug #654 : Comments affect indent check for BSDAllman brace style +- Fixed bug #658 : Squiz.Functions.FunctionDeclarationSpacing error for multi-line declarations with required spaces greater than zero + - Thanks to J.D. Grimes for the patch +- Fixed bug #663 : No space after class name generates: Class name "" is not in camel caps format +- Fixed bug #667 : Scope indent check can go into infinite loop due to some parse errors +- Fixed bug #670 : Endless loop in PSR1 SideEffects sniffer if no semicolon after last statement + - Thanks to Thomas Jarosch for the patch +- Fixed bug #672 : Call-time pass-by-reference false positive +- Fixed bug #683 : Comments are incorrectly reported by PSR2.ControlStructures.SwitchDeclaration sniff +- Fixed bug #687 : ScopeIndent does not check indent correctly for method prefixes like public and abstract +- Fixed bug #689 : False error on some comments after class closing brace + +## [2.3.3] - 2015-06-24 +### Changed +- Improved the performance of the CSS tokenizer, especially on very large CSS files (thousands of lines) + - Thanks to Klaus Purer for the patch +- Defined tokens for lower PHP versions are now phpcs-specific strings instead of ints + - Stops conflict with other projects, like PHP_CodeCoverage +- Added more guard code for syntax errors to various sniffs +- Improved support for older HHVM versions + - Thanks to Kunal Mehta for the patch +- Squiz ValidLogicalOperatorsSniff now ignores XOR as type casting is different when using the ^ operator (request #567) +- Squiz CommentedOutCodeSniff is now better at ignoring URLs inside comments +- Squiz ControlSignatureSniff is now better at checking embedded PHP code +- Squiz ScopeClosingBraceSniff is now better at checking embedded PHP code + +### Fixed +- Fixed bug #584 : Squiz.Arrays.ArrayDeclaration sniff gives incorrect NoComma error for multiline string values +- Fixed bug #589 : PEAR.Functions.FunctionCallSignature sniff not checking all function calls +- Fixed bug #592 : USE statement tokenising can sometimes result in mismatched scopes +- Fixed bug #594 : Tokenizer issue on closure that returns by reference +- Fixed bug #595 : Colons in CSS selectors within media queries throw false positives + - Thanks to Klaus Purer for the patch +- Fixed bug #598 : PHPCBF can break function/use closure brace placement +- Fixed bug #603 : Squiz ControlSignatureSniff hard-codes opener type while fixing +- Fixed bug #605 : Auto report-width specified in ruleset.xml ignored +- Fixed bug #611 : Invalid numeric literal on CSS files under PHP7 +- Fixed bug #612 : Multi-file diff generating incorrectly if files do not end with EOL char +- Fixed bug #615 : Squiz OperatorBracketSniff incorrectly reports and fixes operations using self:: +- Fixed bug #616 : Squiz DisallowComparisonAssignmentSniff inconsistent errors with inline IF statements +- Fixed bug #617 : Space after switch keyword in PSR-2 is not being enforced +- Fixed bug #621 : PSR2 SwitchDeclaration sniff doesn't detect, or correctly fix, case body on same line as statement + +## [2.3.2] - 2015-04-29 +### Changed +- The error message for PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase is now clearer (request #579) + +### Fixed +- Fixed bug #545 : Long list of CASE statements can cause tokenizer to reach a depth limit +- Fixed bug #565 : Squiz.WhiteSpace.OperatorSpacing reports negative number in short array + - Thanks to Vašek Purchart for the patch + - Same fix also applied to Squiz.Formatting.OperatorBracket +- Fixed bug #569 : Generic ScopeIndentSniff throws PHP notices in JS files +- Fixed bug #570 : Phar class fatals in PHP less than 5.3 + +## [2.3.1] - 2015-04-23 +### Changed +- PHPCS can now exit with 0 even if errors are found + - Set the ignore_errors_on_exit config variable to 1 to set this behaviour + - Use with the ignore_warnings_on_exit config variable to never return a non-zero exit code +- Added Generic DisallowLongArraySyntaxSniff to enforce the use of the PHP short array syntax (request #483) + - Thanks to Xaver Loppenstedt for helping with tests +- Added Generic DisallowShortArraySyntaxSniff to ban the use of the PHP short array syntax (request #483) + - Thanks to Xaver Loppenstedt for helping with tests +- Generic ScopeIndentSniff no longer does exact checking for content inside parenthesis (request #528) + - Only applies to custom coding standards that set the "exact" flag to TRUE +- Squiz ConcatenationSpacingSniff now has a setting to ignore newline characters around operators (request #511) + - Default remains FALSE, so newlines are not allowed + - Override the "ignoreNewlines" setting in a ruleset.xml file to change +- Squiz InlineCommentSniff no longer checks the last char of a comment if the first char is not a letter (request #505) +- The Squiz standard has increased the max padding for statement alignment from 12 to 20 + +### Fixed +- Fixed bug #479 : Yielded values are not recognised as returned values in Squiz FunctionComment sniff +- Fixed bug #512 : Endless loop whilst parsing mixture of control structure styles +- Fixed bug #515 : Spaces in JS block incorrectly flagged as indentation error +- Fixed bug #523 : Generic ScopeIndent errors for IF in FINALLY +- Fixed bug #527 : Closure inside IF statement is not tokenized correctly +- Fixed bug #529 : Squiz.Strings.EchoedStrings gives false positive when echo'ing using an inline condition +- Fixed bug #537 : Using --config-set is breaking phpcs.phar +- Fixed bug #543 : SWITCH with closure in condition generates inline control structure error +- Fixed bug #551 : Multiple catch blocks not checked in Squiz.ControlStructures.ControlSignature sniff +- Fixed bug #554 : ScopeIndentSniff causes errors when encountering an unmatched parenthesis +- Fixed bug #558 : PHPCBF adds brace for ELSE IF split over multiple lines +- Fixed bug #564 : Generic MultipleStatementAlignment sniff reports incorrect errors for multiple assignments on a single line + +## [2.3.0] - 2015-03-04 +### Changed +- The existence of the main config file is now cached to reduce is_file() calls when it doesn't exist (request #486) +- Abstract classes inside the Sniffs directory are now ignored even if they are named [Name]Sniff.php (request #476) + - Thanks to David Vernet for the patch +- PEAR and Squiz FileComment sniffs no longer have @ in their error codes + - e.g., PEAR.Commenting.FileComment.Duplicate@categoryTag becomes PEAR.Commenting.FileComment.DuplicateCategoryTag + - e.g., Squiz.Commenting.FileComment.Missing@categoryTag becomes Squiz.Commenting.FileComment.MissingCategoryTag +- PEAR MultiLineConditionSniff now allows comment lines inside multi-line IF statement conditions + - Thanks to Klaus Purer for the patch +- Generic ForbiddenFunctionsSniff now supports setting null replacements in ruleset files (request #263) +- Generic opening function brace sniffs now support checking of closures + - Set the checkClosures property to TRUE (default is FALSE) in your ruleset.xml file to enable this + - Can also set the checkFunctions property to FALSE (default is TRUE) in your ruleset.xml file to only check closures + - Affects OpeningFunctionBraceBsdAllmanSniff and OpeningFunctionBraceKernighanRitchieSniff +- Generic OpeningFunctionBraceKernighanRitchieSniff can now fix all the errors it finds +- Generic OpeningFunctionBraceKernighanRitchieSniff now allows empty functions with braces next to each other +- Generic OpeningFunctionBraceBsdAllmanSniff now allows empty functions with braces next to each other +- Improved auto report width for the "full" report +- Improved conflict detection during auto fixing +- Generic ScopeIndentSniff is no longer confused by empty closures +- Squiz ControlSignatureSniff now always ignores comments (fixes bug #490) + - Include the Squiz.Commenting.PostStatementComment sniff in your ruleset.xml to ban these comments again +- Squiz OperatorSpacingSniff no longer throws errors for code in the form ($foo || -1 === $bar) +- Fixed errors tokenizing T_ELSEIF tokens on HHVM 3.5 +- Squiz ArrayDeclarationSniff is no longer tricked by comments after array values +- PEAR IncludingFileSniff no longer produces invalid code when removing parenthesis from require/include statements + +### Fixed +- Fixed bug #415 : The @codingStandardsIgnoreStart has no effect during fixing +- Fixed bug #432 : Properties of custom sniffs cannot be configured +- Fixed bug #453 : PSR2 standard does not allow closing tag for mixed PHP/HTML files +- Fixed bug #457 : FunctionCallSignature sniffs do not support here/nowdoc syntax and can cause syntax error when fixing +- Fixed bug #466 : PropertyLabelSpacing JS fixer issue when there is no space after colon +- Fixed bug #473 : Writing a report for an empty folder to existing file includes the existing contents +- Fixed bug #485 : PHP notice in Squiz.Commenting.FunctionComment when checking malformed @throws comment +- Fixed bug #491 : Generic InlineControlStructureSniff can correct with missing semicolon + - Thanks to Jesse Donat for the patch +- Fixed bug #492 : Use statements don't increase the scope indent +- Fixed bug #493 : PSR1_Sniffs_Methods_CamelCapsMethodNameSniff false positives for some magic method detection + - Thanks to Andreas Möller for the patch +- Fixed bug #496 : Closures in PSR2 are not checked for a space after the function keyword +- Fixed bug #497 : Generic InlineControlStructureSniff does not support alternative SWITCH syntax +- Fixed bug #500 : Functions not supported as values in Squiz ArrayDeclaration sniff +- Fixed bug #501 : ScopeClosingBrace and ScopeIndent conflict with closures used as array values + - Generic ScopeIndentSniff may now report fewer errors for closures, but perform the same fixes +- Fixed bug #502 : PSR1 SideEffectsSniff sees declare() statements as side effects + +## [2.2.0] - 2015-01-22 +### Changed +- Added (hopefully) tastefully used colors to report and progress output for the phpcs command + - Use the --colors command line argument to use colors in output + - Use the command "phpcs --config-set colors true" to turn colors on by default + - Use the --no-colors command line argument to turn colors off when the config value is set +- Added support for using the full terminal width for report output + - Use the --report-width=auto command line argument to auto-size the reports + - Use the command "phpcs --config-set report_width auto" to use auto-sizing by default +- Reports will now size to fit inside the report width setting instead of always using padding to fill the space +- If no files or standards are specified, PHPCS will now look for a phpcs.xml file in the current directory + - This file has the same format as a standard ruleset.xml file + - The phpcs.xml file should specify (at least) files to process and a standard/sniffs to use + - Useful for running the phpcs and phpcbf commands without any arguments at the top of a repository +- Default file paths can now be specified in a ruleset.xml file using the "file" tag + - File paths are only processed if no files were specified on the command line +- Extensions specified on the CLI are now merged with those set in ruleset.xml files + - Previously, the ruleset.xml file setting replaced the CLI setting completely +- Squiz coding standard now requires lowercase PHP constants (true, false and null) + - Removed Squiz.NamingConventions.ConstantCase sniff as the rule is now consistent across PHP and JS files +- Squiz FunctionOpeningBraceSpaceSniff no longer does additional checks for JS functions + - PHP and JS functions and closures are now treated the same way +- Squiz MultiLineFunctionDeclarationSniff now supports JS files +- Interactive mode no longer breaks if you also specify a report type on the command line +- PEAR InlineCommentSniff now fixes the Perl-style comments that it finds (request #375) +- PSR2 standard no longer fixes the placement of docblock open tags as comments are excluded from this standard +- PSR2 standard now sets a default tab width of 4 spaces +- Generic DocCommentSniff now only disallows lowercase letters at the start of a long/short comment (request #377) + - All non-letter characters are now allowed, including markdown special characters and numbers +- Generic DisallowMultipleStatementsSniff now allows multiple open/close tags on the same line (request #423) +- Generic CharacterBeforePHPOpeningTagSniff now only checks the first PHP tag it finds (request #423) +- Generic CharacterBeforePHPOpeningTagSniff now allows a shebang line at the start of the file (request #20481) +- Generic InlineHTMLUnitTest now allows a shebang line at the start of the file (request #20481) +- PEAR ObjectOperatorIndentSniff now only checks object operators at the start of a line +- PEAR FileComment and ClassComment sniffs no longer have @ in their error codes + - E.g., PEAR.Commenting.FileComment.Missing@categoryTag becomes PEAR.Commenting.FileComment.MissingCategoryTag + - Thanks to Grzegorz Rygielski for the patch +- Squiz ControlStructureSpacingSniff no longer enforces a blank line before CATCH statements +- Squiz FunctionCommentSniff now fixes the return type in the @return tag (request #392) +- Squiz BlockCommentSniff now only disallows lowercase letters at the start of the comment +- Squiz InlineCommentSniff now only disallows lowercase letters at the start of the comment +- Squiz OperatorSpacingSniff now has a setting to ignore newline characters around operators (request #348) + - Default remains FALSE, so newlines are not allowed + - Override the "ignoreNewlines" setting in a ruleset.xml file to change +- PSR2 ControlStructureSpacingSniff now checks for, and fixes, newlines after the opening parenthesis +- Added a markdown document generator (--generator=markdown to use) + - Thanks to Stefano Kowalke for the contribution + +### Fixed +- Fixed bug #379 : Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast incorrectly detects comments +- Fixed bug #382 : JS tokenizer incorrect for inline conditionally created immediately invoked anon function +- Fixed bug #383 : Squiz.Arrays.ArrayDeclaration.ValueNoNewline incorrectly detects nested arrays +- Fixed bug #386 : Undefined offset in Squiz.FunctionComment sniff when param has no comment +- Fixed bug #390 : Indentation of non-control structures isn't adjusted when containing structure is fixed +- Fixed bug #400 : InlineControlStructureSniff fails to fix when statement has no semicolon +- Fixed bug #401 : PHPCBF no-patch option shows an error when there are no fixable violations in a file +- Fixed bug #405 : The "Squiz.WhiteSpace.FunctionSpacing" sniff removes class "}" during fixing +- Fixed bug #407 : PEAR.ControlStructures.MultiLineCondition doesn't account for comments at the end of lines +- Fixed bug #410 : The "Squiz.WhiteSpace.MemberVarSpacing" not respecting "var" +- Fixed bug #411 : Generic.WhiteSpace.ScopeIndent.Incorrect - false positive with multiple arrays in argument list +- Fixed bug #412 : PSR2 multi-line detection doesn't work for inline IF and string concats +- Fixed bug #414 : Squiz.WhiteSpace.MemberVarSpacing - inconsistent checking of member vars with comment +- Fixed bug #433 : Wrong detection of Squiz.Arrays.ArrayDeclaration.KeyNotAligned when key contains space +- Fixed bug #434 : False positive for spacing around "=>" in inline array within foreach +- Fixed bug #452 : Ruleset exclude-pattern for specific sniff code ignored when using CLI --ignore option +- Fixed bug #20482 : Scope indent sniff can get into infinite loop when processing a parse error + +## [2.1.0] - 2014-12-18 +### Changed +- Time and memory output is now shown if progress information is also shown (request #335) +- A tilde can now be used to reference a user's home directory in a path to a standard (request #353) +- Added PHP_CodeSniffer_File::findStartOfStatement() to find the first non-whitespace token in a statement + - Possible alternative for code using PHP_CodeSniffer_File::findPrevious() with the local flag set +- Added PHP_CodeSniffer_File::findEndOfStatement() to find the last non-whitespace token in a statement + - Possible alternative for code using PHP_CodeSniffer_File::findNext() with the local flag set +- Generic opening function brace sniffs now ensure the opening brace is the last content on the line + - Affects OpeningFunctionBraceBsdAllmanSniff and OpeningFunctionBraceKernighanRitchieSniff + - Also enforced in PEAR FunctionDeclarationSniff and Squiz MultiLineFunctionDeclarationSniff +- Generic DisallowTabIndentSniff now replaces tabs everywhere it finds them, except in strings and here/now docs +- Generic EmptyStatementSniff error codes now contain the type of empty statement detected (request #314) + - All messages generated by this sniff are now errors (empty CATCH was previously a warning) + - Message code Generic.CodeAnalysis.EmptyStatement.NotAllowed has been removed + - Message code Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning has been removed + - New message codes have the format Generic.CodeAnalysis.EmptyStatement.Detected[TYPE] + - Example code is Generic.CodeAnalysis.EmptyStatement.DetectedCATCH + - You can now use a custom ruleset to change messages to warnings and to exclude them +- PEAR and Squiz FunctionCommentSniffs no longer ban @return tags for constructors and destructors + - Removed message PEAR.Commenting.FunctionComment.ReturnNotRequired + - Removed message Squiz.Commenting.FunctionComment.ReturnNotRequired + - Change initiated by request #324 and request #369 +- Squiz EmptyStatementSniff has been removed + - Squiz standard now includes Generic EmptyStatementSniff and turns off the empty CATCH error +- Squiz ControlSignatureSniff fixes now retain comments between the closing parenthesis and open brace +- Squiz SuperfluousWhitespaceSniff now checks for extra blank lines inside closures + - Thanks to Sertan Danis for the patch +- Squiz ArrayDeclarationSniff now skips function calls while checking multi-line arrays + +### Fixed +- Fixed bug #337 : False positive with anonymous functions in Generic_Sniffs_WhiteSpace_ScopeIndentSniff +- Fixed bug #339 : reformatting brace location can result in broken code +- Fixed bug #342 : Nested ternary operators not tokenized correctly +- Fixed bug #345 : Javascript regex not tokenized when inside array +- Fixed bug #346 : PHP path can't be determined in some cases in "phpcs.bat" (on Windows XP) +- Fixed bug #358 : False positives for Generic_Sniffs_WhiteSpace_ScopeIndentSniff +- Fixed bug #361 : Sniff-specific exclude patterns don't work for Windows +- Fixed bug #364 : Don't interpret "use function" as declaration +- Fixed bug #366 : phpcbf with PSR2 errors on control structure alternative syntax +- Fixed bug #367 : Nested Anonymous Functions Causing False Negative +- Fixed bug #371 : Shorthand binary cast causes tokenizer errors + - New token T_BINARY_CAST added for the b"string" cast format (the 'b' is the T_BINARY_CAST token) +- Fixed bug #372 : phpcbf parse problem, wrong brace placement for inline IF +- Fixed bug #373 : Double quote usage fix removing too many double quotes +- Fixed bug #20196 : 1.5.2 breaks scope_closer position + +## [2.0.0] - 2014-12-05 +### Changed +- JS tokenizer now sets functions as T_CLOSUREs if the function is anonymous +- JS tokenizer now sets all objects to T_OBJECT + - Object end braces are set to a new token T_CLOSE_OBJECT + - T_OBJECT tokens no longer act like scopes; i.e., they have no condition/opener/closer + - T_PROPERTY tokens no longer act like scopes; i.e., they have no condition/opener/closer + - T_OBJECT tokens have a bracket_closer instead, which can be used to find the ending + - T_CLOSE_OBJECT tokens have a bracket_opener +- Improved regular expression detection in the JS tokenizer +- You can now get PHP_CodeSniffer to ignore a single line by putting @codingStandardsIgnoreLine in a comment + - When the comment is found, the comment line and the following line will be ignored + - Thanks to Andy Bulford for the contribution +- PHPCBF now prints output when it is changing into directories +- Improved conflict detection during auto fixing +- The -vvv command line argument will now output the current file content for each loop during fixing +- Generic ScopeIndentSniff now checks that open/close PHP tags are aligned to the correct column +- PEAR FunctionCallSignatureSniff now checks indent of closing parenthesis even if it is not on a line by itself +- PEAR FunctionCallSignatureSniff now supports JS files +- PEAR MultiLineConditionSniff now supports JS files +- Squiz DocCommentAlignmentSniff now supports JS files +- Fixed a problem correcting the closing brace line in Squiz ArrayDeclarationSniff +- Fixed a problem auto-fixing the Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeNestedClose error +- Squiz EmbeddedPhpSniff no longer reports incorrect alignment of tags when they are not on new lines +- Squiz EmbeddedPhpSniff now aligns open tags correctly when moving them onto a new line +- Improved fixing of arrays with multiple values in Squiz ArrayDeclarationSniff +- Improved detection of function comments in Squiz FunctionCommentSpacingSniff +- Improved fixing of lines after cases statements in Squiz SwitchDeclarationSniff + +### Fixed +- Fixed bug #311 : Suppression of function prototype breaks checking of lines within function +- Fixed bug #320 : Code sniffer indentation issue +- Fixed bug #333 : Nested ternary operators causing problems + +## [1.5.6] - 2014-12-05 +### Changed +- JS tokenizer now detects xor statements correctly +- The --config-show command now pretty-prints the config values + - Thanks to Ken Guest for the patch +- Setting and removing config values now catches exceptions if the config file is not writable + - Thanks to Ken Guest for the patch +- Setting and removing config values now prints a message to confirm the action and show old values +- You can now get PHP_CodeSniffer to ignore a single line by putting @codingStandardsIgnoreLine in a comment + - When the comment is found, the comment line and the following line will be ignored + - Thanks to Andy Bulford for the contribution +- Generic ConstructorNameSniff no longer errors for PHP4 style constructors when __construct() is present + - Thanks to Thibaud Fabre for the patch + +### Fixed +- Fixed bug #280 : The --config-show option generates error when there is no config file +- Fixed bug #306 : File containing only a namespace declaration raises undefined index notice +- Fixed bug #308 : Squiz InlineIfDeclarationSniff fails on ternary operators inside closure +- Fixed bug #310 : Variadics not recognized by tokenizer +- Fixed bug #311 : Suppression of function prototype breaks checking of lines within function + +## [2.0.0RC4] - 2014-11-07 +### Changed +- JS tokenizer now detects xor statements correctly +- Improved detection of properties and objects in the JS tokenizer +- Generic ScopeIndentSniff can now fix indents using tabs instead of spaces + - Set the tabIndent property to TRUE in your ruleset.xml file to enable this + - It is important to also set a tab-width setting, either in the ruleset or on the command line, for accuracy +- Generic ScopeIndentSniff now checks and auto-fixes JS files +- Generic DisallowSpaceIndentSniff is now able to replace space indents with tab indents during fixing +- Support for phpcs-only and phpcbf-only attributes has been added to all ruleset.xml elements + - Allows parts of the ruleset to only apply when using a specific tool + - Useful for doing things like excluding indent fixes but still reporting indent errors +- Unit tests can now set command line arguments during a test run + - Override getCliValues() and pass an array of CLI arguments for each file being tested +- File-wide sniff properties can now be set using T_INLINE_HTML content during unit test runs + - Sniffs that start checking at the open tag can only, normally, have properties set using a ruleset +- Generic ConstructorNameSniff no longer errors for PHP4 style constructors when __construct() is present + - Thanks to Thibaud Fabre for the patch +- Generic DocCommentSniff now checks that the end comment tag is on a new line +- Generic MultipleStatementAlignmentSniff no longer skips assignments for closures +- Squiz DocCommentAlignment sniff now has better checking for single line doc block +- Running unit tests with the -v CLI argument no longer generates PHP errors + +### Fixed +- Fixed bug #295 : ScopeIndentSniff hangs when processing nested closures +- Fixed bug #298 : False positive in ScopeIndentSniff when anonymous functions are used with method chaining +- Fixed bug #302 : Fixing code in Squiz InlineComment sniff can remove some comment text +- Fixed bug #303 : Open and close tag on same line can cause a PHP notice checking scope indent +- Fixed bug #306 : File containing only a namespace declaration raises undefined index notice +- Fixed bug #307 : Conditional breaks in case statements get incorrect indentations +- Fixed bug #308 : Squiz InlineIfDeclarationSniff fails on ternary operators inside closure +- Fixed bug #310 : Variadics not recognized by tokenizer + +## [2.0.0RC3] - 2014-10-16 +### Changed +- Improved default output for PHPCBF and removed the options to print verbose and progress output +- If a .fixed file is supplied for a unit test file, the auto fixes will be checked against it during testing + - See Generic ScopeIndentUnitTest.inc and ScopeIndentUnitTest.inc.fixed for an example +- Fixer token replacement methods now return TRUE if the change was accepted and FALSE if rejected +- The --config-show command now pretty-prints the config values + - Thanks to Ken Guest for the patch +- Setting and removing config values now catches exceptions if the config file is not writable + - Thanks to Ken Guest for the patch +- Setting and removing config values now prints a message to confirm the action and show old values +- Generic ScopeIndentSniff has been completely rewritten to improve fixing and embedded PHP detection +- Generic DisallowTabIndent and DisallowSpaceIndent sniffs now detect indents at the start of block comments +- Generic DisallowTabIndent and DisallowSpaceIndent sniffs now detect indents inside multi-line strings +- Generic DisallowTabIndentSniff now replaces tabs inside doc block comments +- Squiz ControlStructureSpacingSniff error codes have been corrected; they were reversed +- Squiz EmbeddedPhpSniff now checks open and close tag indents and fixes some errors +- Squiz FileCommentSniff no longer throws incorrect blank line before comment errors in JS files +- Squiz ClassDeclarationSniff now has better checking for blank lines after a closing brace +- Removed error Squiz.Classes.ClassDeclaration.NoNewlineAfterCloseBrace (request #285) + - Already handled by Squiz.Classes.ClassDeclaration.CloseBraceSameLine + +### Fixed +- Fixed bug #280 : The --config-show option generates error when there is no config file + +## [2.0.0RC2] - 2014-09-26 +### Changed +- Minified JS and CSS files are now detected and skipped (fixes bug #252 and bug #19899) + - A warning will be added to the file so it can be found in the report and ignored in the future +- Fixed incorrect length of JS object operator tokens +- PHP tokenizer no longer converts class/function names to special tokens types + - Class/function names such as parent and true would become special tokens such as T_PARENT and T_TRUE +- PHPCS can now exit with 0 if only warnings were found (request #262) + - Set the ignore_warnings_on_exit config variable to 1 to set this behaviour + - Default remains at exiting with 0 only if no errors and no warnings were found + - Also changes return value of PHP_CodeSniffer_Reporting::printReport() +- Rulesets can now set associative array properties + - property name="[property]" type="array" value="foo=>bar,baz=>qux" +- Generic ForbiddenFunctionsSniff now has a public property called forbiddenFunctions (request #263) + - Override the property in a ruleset.xml file to define forbidden functions and their replacements + - A replacement of NULL indicates that no replacement is available + - e.g., value="delete=>unset,print=>echo,create_function=>null" + - Custom sniffs overriding this one will need to change the visibility of their member var +- Improved closure support in Generic ScopeIndentSniff +- Improved indented PHP tag support in Generic ScopeIndentSniff +- Improved fixing of mixed line indents in Generic ScopeIndentSniff +- Added conflict detection to the file fixer + - If 2 sniffs look to be conflicting, one change will be ignored to allow a fix to occur +- Generic CamelCapsFunctionNameSniff now ignores a single leading underscore + - Thanks to Alex Slobodiskiy for the patch +- Standards can now be located within hidden directories (further fix for bug #20323) + - Thanks to Klaus Purer for the patch +- Sniff ignore patterns now replace Win dir separators like file ignore patterns already did +- Exclude patterns now use backtick delimiters, allowing all special characters to work correctly again + - Thanks to Jeremy Edgell for the patch +- Errors converted to warnings in a ruleset (and vice versa) now retain their fixable status + - Thanks to Alexander Obuhovich for the patch +- Squiz ConcatenationSpacingSniff now has a setting to specify how many spaces there should around concat operators + - Default remains at 0 + - Override the "spacing" setting in a ruleset.xml file to change +- Added auto-fixes for Squiz InlineCommentSniff +- Generic DocCommentSniff now correctly fixes additional blank lines at the end of a comment +- Squiz OperatorBracketSniff now correctly fixes operations that include arrays +- Zend ClosingTagSniff fix now correctly leaves closing tags when followed by HTML +- Added Generic SyntaxSniff to check for syntax errors in PHP files + - Thanks to Blaine Schmeisser for the contribution +- Added Generic OneTraitPerFileSniff to check that only one trait is defined in each file + - Thanks to Alexander Obuhovich for the contribution +- Squiz DiscouragedFunctionsSniff now warns about var_dump() +- PEAR ValidFunctionNameSniff no longer throws an error for _() +- Squiz and PEAR FunctionCommentSniffs now support _() +- Generic DisallowTabIndentSniff now checks for, and fixes, mixed indents again +- Generic UpperCaseConstantSniff and LowerCaseConstantSniff now ignore function names + +### Fixed +- Fixed bug #243 : Missing DocBlock not detected +- Fixed bug #248 : FunctionCommentSniff expects ampersand on param name +- Fixed bug #265 : False positives with type hints in ForbiddenFunctionsSniff +- Fixed bug #20373 : Inline comment sniff tab handling way +- Fixed bug #20377 : Error when trying to execute phpcs with report=json +- Fixed bug #20378 : Report appended to existing file if no errors found in run +- Fixed bug #20381 : Invalid "Comment closer must be on a new line" + - Thanks to Brad Kent for the patch +- Fixed bug #20402 : SVN pre-commit hook fails due to unknown argument error + +## [1.5.5] - 2014-09-25 +### Changed +- PHP tokenizer no longer converts class/function names to special tokens types + - Class/function names such as parent and true would become special tokens such as T_PARENT and T_TRUE +- Improved closure support in Generic ScopeIndentSniff +- Improved indented PHP tag support in Generic ScopeIndentSniff +- Generic CamelCapsFunctionNameSniff now ignores a single leading underscore + - Thanks to Alex Slobodiskiy for the patch +- Standards can now be located within hidden directories (further fix for bug #20323) + - Thanks to Klaus Purer for the patch +- Added Generic SyntaxSniff to check for syntax errors in PHP files + - Thanks to Blaine Schmeisser for the contribution +- Squiz DiscouragedFunctionsSniff now warns about var_dump() +- PEAR ValidFunctionNameSniff no longer throws an error for _() +- Squiz and PEAR FunctionCommentSnif now support _() +- Generic UpperCaseConstantSniff and LowerCaseConstantSniff now ignore function names + +### Fixed +- Fixed bug #248 : FunctionCommentSniff expects ampersand on param name +- Fixed bug #265 : False positives with type hints in ForbiddenFunctionsSniff +- Fixed bug #20373 : Inline comment sniff tab handling way +- Fixed bug #20378 : Report appended to existing file if no errors found in run +- Fixed bug #20381 : Invalid "Comment closer must be on a new line" + - Thanks to Brad Kent for the patch +- Fixed bug #20386 : Squiz.Commenting.ClassComment.SpacingBefore thrown if first block comment + +## [2.0.0RC1] - 2014-08-06 +### Changed +- PHPCBF will now fix incorrect newline characters in a file +- PHPCBF now exists cleanly when there are no errors to fix +- Added phpcbf.bat file for Windows +- Verbose option no longer errors when using a phar file with a space in the path +- Fixed a reporting error when using HHVM + - Thanks to Martins Sipenko for the patch +- addFixableError() and addFixableWarning() now only return true if the fixer is enabled + - Saves checking ($phpcsFile->fixer->enabled === true) before every fix +- Added addErrorOnLine() and addWarningOnLine() to add a non-fixable violation to a line at column 1 + - Useful if you are generating errors using an external tool or parser and only know line numbers + - Thanks to Ondřej Mirtes for the patch +- CSS tokenizer now identifies embedded PHP code using the new T_EMBEDDED_PHP token type + - The entire string of PHP is contained in a single token +- PHP tokenizer contains better detection of short array syntax +- Unit test runner now also test any standards installed under the installed_paths config var +- Exclude patterns now use {} delimiters, allowing the | special character to work correctly again +- The filtering component of the --extensions argument is now ignored again when passing filenames + - Can still be used to specify a custom tokenizer for each extension when passing filenames + - If no tokenizer is specified, default values will be used for common file extensions +- Diff report now produces relative paths on Windows, where possible (further fix for bug #20234) +- If a token's content has been modified by the tab-width setting, it will now have an orig_content in the tokens array +- Generic DisallowSpaceIndent and DisallowTabIndent sniffs now check original indent content even when tab-width is set + - Previously, setting --tab-width would force both to check the indent as spaces +- Fixed a problem where PHPCBF could replace tabs with too many spaces when changing indents +- Fixed a problem that could occur with line numbers when using HHVM to check files with Windows newline characters +- Removed use of sys_get_temp_dir() as this is not supported by the min PHP version +- Squiz ArrayDeclarationSniff now supports short array syntax +- Squiz ControlSignatureSniff no longer uses the Abstract Pattern sniff + - If you are extending this sniff, you'll need to rewrite your code + - The rewrite allows this sniff to fix all control structure formatting issues it finds +- The installed_paths config var now accepts relative paths + - The paths are relative to the PHP_CodeSniffer install directory + - Thanks to Weston Ruter for the patch +- Generic ScopeIndentSniff now accounts for different open tag indents +- PEAR FunctionDeclarationSniff now ignores short arrays when checking indent + - Thanks to Daniel Tschinder for the patch +- PSR2 FunctionCallSignatureSniff now treats multi-line strings as a single-line argument, like arrays and closures + - Thanks to Dawid Nowak for the patch +- PSR2 UseDeclarationSniff now checks for a single space after the USE keyword +- Generic ForbiddenFunctionsSniff now detects calls to functions in the global namespace + - Thanks to Ole Martin Handeland for the patch +- Generic LowerCaseConstantSniff and UpperCaseConstantSniff now ignore namespaces beginning with TRUE/FALSE/NULL + - Thanks to Renan Gonçalves for the patch +- Squiz InlineCommentSniff no longer requires a blank line after post-statement comments (request #20299) +- Squiz SelfMemberReferenceSniff now works correctly with namespaces +- Squiz FunctionCommentSniff is now more relaxed when checking namespaced type hints +- Tab characters are now encoded in abstract pattern errors messages + - Thanks to Blaine Schmeisser for the patch +- Invalid sniff codes passed to --sniffs now show a friendly error message (request #20313) +- Generic LineLengthSniff now shows a warning if the iconv module is disabled (request #20314) +- Source report no longer shows errors if category or sniff names ends in an uppercase error + - Thanks to Jonathan Marcil for the patch + +### Fixed +- Fixed bug #20261 : phpcbf has an endless fixing loop +- Fixed bug #20268 : Incorrect documentation titles in PEAR documentation +- Fixed bug #20296 : new array notion in function comma check fails +- Fixed bug #20297 : phar does not work when renamed it to phpcs +- Fixed bug #20307 : PHP_CodeSniffer_Standards_AbstractVariableSniff analyze traits +- Fixed bug #20308 : Squiz.ValidVariableNameSniff - wrong variable usage +- Fixed bug #20309 : Use "member variable" term in sniff "processMemberVar" method +- Fixed bug #20310 : PSR2 does not check for space after function name +- Fixed bug #20322 : Display rules set to type=error even when suppressing warnings +- Fixed bug #20323 : PHPCS tries to load sniffs from hidden directories +- Fixed bug #20346 : Fixer endless loop with Squiz.CSS sniffs +- Fixed bug #20355 : No sniffs are registered with PHAR on Windows + +## [1.5.4] - 2014-08-06 +### Changed +- Removed use of sys_get_temp_dir() as this is not supported by the min PHP version +- The installed_paths config var now accepts relative paths + - The paths are relative to the PHP_CodeSniffer install directory + - Thanks to Weston Ruter for the patch +- Generic ScopeIndentSniff now accounts for different open tag indents +- PEAR FunctionDeclarationSniff now ignores short arrays when checking indent + - Thanks to Daniel Tschinder for the patch +- PSR2 FunctionCallSignatureSniff now treats multi-line strings as a single-line argument, like arrays and closures + - Thanks to Dawid Nowak for the patch +- Generic ForbiddenFunctionsSniff now detects calls to functions in the global namespace + - Thanks to Ole Martin Handeland for the patch +- Generic LowerCaseConstantSniff and UpperCaseConstantSniff now ignore namespaces beginning with TRUE/FALSE/NULL + - Thanks to Renan Gonçalves for the patch +- Squiz InlineCommentSniff no longer requires a blank line after post-statement comments (request #20299) +- Squiz SelfMemberReferenceSniff now works correctly with namespaces +- Tab characters are now encoded in abstract pattern errors messages + - Thanks to Blaine Schmeisser for the patch +- Invalid sniff codes passed to --sniffs now show a friendly error message (request #20313) +- Generic LineLengthSniff now shows a warning if the iconv module is disabled (request #20314) +- Source report no longer shows errors if category or sniff names ends in an uppercase error + - Thanks to Jonathan Marcil for the patch + +### Fixed +- Fixed bug #20268 : Incorrect documentation titles in PEAR documentation +- Fixed bug #20296 : new array notion in function comma check fails +- Fixed bug #20307 : PHP_CodeSniffer_Standards_AbstractVariableSniff analyze traits +- Fixed bug #20308 : Squiz.ValidVariableNameSniff - wrong variable usage +- Fixed bug #20309 : Use "member variable" term in sniff "processMemberVar" method +- Fixed bug #20310 : PSR2 does not check for space after function name +- Fixed bug #20322 : Display rules set to type=error even when suppressing warnings +- Fixed bug #20323 : PHPCS tries to load sniffs from hidden directories + +## [2.0.0a2] - 2014-05-01 +### Changed +- Added report type --report=info to show information about the checked code to make building a standard easier + - Checks a number of things, such as what line length you use, and spacing are brackets, but not everything + - Still highly experimental +- Generic LineLengthSniff now shows warnings for long lines referring to licence and VCS information + - It previously ignored these lines, but at the expense of performance +- Generic DisallowTabIndent and DisallowSpaceIndent sniffs no longer error when detecting mixed indent types + - Only the first type of indent found on a line (space or indent) is considered +- Lots of little performance improvements that can add up to a substantial saving over large code bases + - Added a "length" array index to tokens so you don't need to call strlen() of them, or deal with encoding + - Can now use isset() to find tokens inside the PHP_CodeSniffer_Tokens static vars instead of in_array() +- Custom reports can now specify a $recordErrors member var; this previously only worked for built-in reports + - When set to FALSE, error messages will not be recorded and only totals will be returned + - This can save significant memory while processing a large code base +- Removed dependence on PHP_Timer +- PHP tokenizer now supports DEFAULT statements opened with a T_SEMICOLON +- The Squiz and PHPCS standards have increased the max padding for statement alignment from 8 to 12 +- Squiz EchoedStringsSniff now supports statements without a semicolon, such as PHP embedded in HTML +- Squiz DoubleQuoteUsageSniff now properly replaces escaped double quotes when fixing a doubled quoted string +- Improved detection of nested IF statements that use the alternate IF/ENDIF syntax +- PSR1 CamelCapsMethodNameSniff now ignores magic methods + - Thanks to Eser Ozvataf for the patch +- PSR1 SideEffectsSniff now ignores methods named define() +- PSR1 and PEAR ClassDeclarationSniffs now support traits (request #20208) +- PSR2 ControlStructureSpacingSniff now allows newlines before/after parentheses + - Thanks to Maurus Cuelenaere for the patch +- PSR2 ControlStructureSpacingSniff now checks TRY and CATCH statements +- Squiz SuperfluousWhitespaceSniff now detects whitespace at the end of block comment lines + - Thanks to Klaus Purer for the patch +- Squiz LowercasePHPFunctionsSniff no longer reports errors for namespaced functions + - Thanks to Max Galbusera for the patch +- Squiz SwitchDeclarationSniff now allows exit() as a breaking statement for case/default +- Squiz ValidVariableNameSniff and Zend ValidVariableNameSniff now ignore additional PHP reserved vars + - Thanks to Mikuláš Dítě and Adrian Crepaz for the patch +- Sniff code Squiz.WhiteSpace.MemberVarSpacing.After changed to Squiz.WhiteSpace.MemberVarSpacing.Incorrect (request #20241) + +### Fixed +- Fixed bug #20200 : Invalid JSON produced with specific error message +- Fixed bug #20204 : Ruleset exclude checks are case sensitive +- Fixed bug #20213 : Invalid error, Inline IF must be declared on single line +- Fixed bug #20225 : array_merge() that takes more than one line generates error +- Fixed bug #20230 : Squiz ControlStructureSpacing sniff assumes specific condition formatting +- Fixed bug #20234 : phpcbf patch command absolute paths +- Fixed bug #20240 : Squiz block comment sniff fails when newline present +- Fixed bug #20247 : The Squiz.WhiteSpace.ControlStructureSpacing sniff and do-while + - Thanks to Alexander Obuhovich for the patch +- Fixed bug #20248 : The Squiz_Sniffs_WhiteSpace_ControlStructureSpacingSniff sniff and empty scope +- Fixed bug #20252 : Unitialized string offset when package name starts with underscore + +## [1.5.3] - 2014-05-01 +### Changed +- Improved detection of nested IF statements that use the alternate IF/ENDIF syntax +- PHP tokenizer now supports DEFAULT statements opened with a T_SEMICOLON +- PSR1 CamelCapsMethodNameSniff now ignores magic methods + - Thanks to Eser Ozvataf for the patch +- PSR1 SideEffectsSniff now ignores methods named define() +- PSR1 and PEAR ClassDeclarationSniffs now support traits (request #20208) +- PSR2 ControlStructureSpacingSniff now allows newlines before/after parentheses + - Thanks to Maurus Cuelenaere for the patch +- Squiz LowercasePHPFunctionsSniff no longer reports errors for namespaced functions + - Thanks to Max Galbusera for the patch +- Squiz SwitchDeclarationSniff now allows exit() as a breaking statement for case/default +- Squiz ValidVariableNameSniff and Zend ValidVariableNameSniff now ignore additional PHP reserved vars + - Thanks to Mikuláš Dítě and Adrian Crepaz for the patch +- Sniff code Squiz.WhiteSpace.MemberVarSpacing.After changed to Squiz.WhiteSpace.MemberVarSpacing.Incorrect (request #20241) + +### Fixed +- Fixed bug #20200 : Invalid JSON produced with specific error message +- Fixed bug #20204 : Ruleset exclude checks are case sensitive +- Fixed bug #20213 : Invalid error, Inline IF must be declared on single line +- Fixed bug #20225 : array_merge() that takes more than one line generates error +- Fixed bug #20230 : Squiz ControlStructureSpacing sniff assumes specific condition formatting +- Fixed bug #20240 : Squiz block comment sniff fails when newline present +- Fixed bug #20247 : The Squiz.WhiteSpace.ControlStructureSpacing sniff and do-while + - Thanks to Alexander Obuhovich for the patch +- Fixed bug #20248 : The Squiz_Sniffs_WhiteSpace_ControlStructureSpacingSniff sniff and empty scope +- Fixed bug #20252 : Uninitialized string offset when package name starts with underscore + +## [2.0.0a1] - 2014-02-05 +### Changed +- Added the phpcbf script to automatically fix many errors found by the phpcs script +- Added report type --report=diff to show suggested changes to fix coding standard violations +- The --report argument now allows for custom reports to be used + - Use the full path to your custom report class as the report name +- The --extensions argument is now respected when passing filenames; not just with directories +- The --extensions argument now allows you to specify the tokenizer for each extension + - e.g., --extensions=module/php,es/js +- Command line arguments can now be set in ruleset files + - e.g., arg name="report" value="summary" (print summary report; same as --report=summary) + - e.g., arg value="sp" (print source and progress information; same as -sp) + - The -vvv, --sniffs, --standard and -l command line arguments cannot be set in this way +- Sniff process() methods can not optionally return a token to ignore up to + - If returned, the sniff will not be executed again until the passed token is reached in the file + - Useful if you are looking for tokens like T_OPEN_TAG but only want to process the first one +- Removed the comment parser classes and replaced it with a simple comment tokenizer + - T_DOC_COMMENT tokens are now tokenized into T_DOC_COMMENT_* tokens so they can be used more easily + - This change requires a significant rewrite of sniffs that use the comment parser + - This change requires minor changes to sniffs that listen for T_DOC_COMMENT tokens directly +- Added Generic DocCommentSniff to check generic doc block formatting + - Removed doc block formatting checks from PEAR ClassCommentSniff + - Removed doc block formatting checks from PEAR FileCommentSniff + - Removed doc block formatting checks from PEAR FunctionCommentSniff + - Removed doc block formatting checks from Squiz ClassCommentSniff + - Removed doc block formatting checks from Squiz FileCommentSniff + - Removed doc block formatting checks from Squiz FunctionCommentSniff + - Removed doc block formatting checks from Squiz VariableCommentSniff +- Squiz DocCommentAlignmentSniff has had its error codes changed + - NoSpaceBeforeTag becomes NoSpaceAfterStar + - SpaceBeforeTag becomes SpaceAfterStar + - SpaceBeforeAsterisk becomes SpaceBeforeStar +- Generic MultipleStatementAlignment now aligns assignments within a block so they fit within their max padding setting + - The sniff previously requested the padding as 1 space if max padding was exceeded + - It now aligns the assignment with surrounding assignments if it can + - Removed property ignoreMultiline as multi-line assignments are now handled correctly and should not be ignored +- Squiz FunctionClosingBraceSpaceSniff now requires a blank line before the brace in all cases except function args +- Added error Squiz.Commenting.ClassComment.SpacingAfter to ensure there are no blank lines after a class comment +- Added error Squiz.WhiteSpace.MemberVarSpacing.AfterComment to ensure there are no blank lines after a member var comment + - Fixes have also been corrected to not strip the member var comment or indent under some circumstances + - Thanks to Mark Scherer for help with this fix +- Added error Squiz.Commenting.FunctionCommentThrowTag.Missing to ensure a throw is documented +- Removed error Squiz.Commenting.FunctionCommentThrowTag.WrongType +- Content passed via STDIN can now specify the filename to use so that sniffs can run the correct filename checks + - Ensure the first line of the content is: phpcs_input_file: /path/to/file +- Squiz coding standard now enforces no closing PHP tag at the end of a pure PHP file +- Squiz coding standard now enforces a single newline character at the end of the file +- Squiz ClassDeclarationSniff no longer checks for a PHP ending tag after a class definition +- Squiz ControlStructureSpacingSniff now checks TRY and CATCH statements as well +- Removed MySource ChannelExceptionSniff + +## [1.5.2] - 2014-02-05 +### Changed +- Improved support for the PHP 5.5. classname::class syntax + - PSR2 SwitchDeclarationSniff no longer throws errors when this syntax is used in CASE conditions +- Improved support for negative checks of instanceOf in Squiz ComparisonOperatorUsageSniff + - Thanks to Martin Winkel for the patch +- Generic FunctionCallArgumentSpacingSniff now longer complains about space before comma when using here/nowdocs + - Thanks to Richard van Velzen for the patch +- Generic LowerCaseConstantSniff and UpperCaseConstantSniff now ignore class constants + - Thanks to Kristopher Wilson for the patch +- PEAR FunctionCallSignatureSniff now has settings to specify how many spaces should appear before/after parentheses + - Override the 'requiredSpacesAfterOpen' and 'requiredSpacesBeforeClose' settings in a ruleset.xml file to change + - Default remains at 0 for both + - Thanks to Astinus Eberhard for the patch +- PSR2 ControlStructureSpacingSniff now has settings to specify how many spaces should appear before/after parentheses + - Override the 'requiredSpacesAfterOpen' and 'requiredSpacesBeforeClose' settings in a ruleset.xml file to change + - Default remains at 0 for both + - Thanks to Astinus Eberhard for the patch +- Squiz ForEachLoopDeclarationSniff now has settings to specify how many spaces should appear before/after parentheses + - Override the 'requiredSpacesAfterOpen' and 'requiredSpacesBeforeClose' settings in a ruleset.xml file to change + - Default remains at 0 for both + - Thanks to Astinus Eberhard for the patch +- Squiz ForLoopDeclarationSniff now has settings to specify how many spaces should appear before/after parentheses + - Override the 'requiredSpacesAfterOpen' and 'requiredSpacesBeforeClose' settings in a ruleset.xml file to change + - Default remains at 0 for both + - Thanks to Astinus Eberhard for the patch +- Squiz FunctionDeclarationArgumentSpacingSniff now has settings to specify how many spaces should appear before/after parentheses + - Override the 'requiredSpacesAfterOpen' and 'requiredSpacesBeforeClose' settings in a ruleset.xml file to change + - Default remains at 0 for both + - Thanks to Astinus Eberhard for the patch +- Removed UnusedFunctionParameter, CyclomaticComplexity and NestingLevel from the Squiz standard +- Generic FixmeSniff and TodoSniff now work correctly with accented characters + +### Fixed +- Fixed bug #20145 : Custom ruleset preferences directory over installed standard +- Fixed bug #20147 : phpcs-svn-pre-commit - no more default error report +- Fixed bug #20151 : Problem handling "if(): ... else: ... endif;" syntax +- Fixed bug #20190 : Invalid regex in Squiz_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff + +## [1.5.1] - 2013-12-12 +### Changed +- Config values can now be set at runtime using the command line argument [--runtime-set key value] + - Runtime values are the same as config values, but are not written to the main config file + - Thanks to Wim Godden for the patch +- Config values can now be set in ruleset files + - e.g., config name="zend_ca_path" value="/path/to/ZendCodeAnalyzer" + - Can not be used to set config values that override command line values, such as show_warnings + - Thanks to Jonathan Marcil for helping with the patch +- Added a new installed_paths config value to allow for the setting of directories that contain standards + - By default, standards have to be installed into the CodeSniffer/Standards directory to be considered installed + - New config value allows a list of paths to be set in addition to this internal path + - Installed standards appear when using the -i arg, and can be referenced in rulesets using only their name + - Set paths by running: phpcs --config-set installed_paths /path/one,/path/two,... +- PSR2 ClassDeclarationSniff now allows a list of extended interfaces to be split across multiple lines +- Squiz DoubleQuoteUsageSniff now allows \b in double quoted strings +- Generic ForbiddenFunctionsSniff now ignores object creation + - This is a further fix for bug #20100 : incorrect Function mysql() has been deprecated report + +### Fixed +- Fixed bug #20136 : Squiz_Sniffs_WhiteSpace_ScopeKeywordSpacingSniff and Traits +- Fixed bug #20138 : Protected property underscore and camel caps issue (in trait with Zend) + - Thanks to Gaetan Rousseau for the patch +- Fixed bug #20139 : No report file generated on success + +## [1.5.0] - 2013-11-28 +### Changed +- Doc generation is now working again for installed standards + - Includes a fix for limiting the docs to specific sniffs +- Generic ScopeIndentSniff now allows for ignored tokens to be set via ruleset.xml files + - E.g., to ignore comments, override a property using: + - name="ignoreIndentationTokens" type="array" value="T_COMMENT,T_DOC_COMMENT" +- PSR2 standard now ignores comments when checking indentation rules +- Generic UpperCaseConstantNameSniff no longer reports errors where constants are used (request #20090) + - It still reports errors where constants are defined +- Individual messages can now be excluded in ruleset.xml files using the exclude tag (request #20091) + - Setting message severity to 0 continues to be supported +- Squiz OperatorSpacingSniff no longer throws errors for the ?: short ternary operator + - Thanks to Antoine Musso for the patch +- Comment parser now supports non-English characters when splitting comment lines into words + - Thanks to Nik Sun for the patch +- Exit statements are now recognised as valid closers for CASE and DEFAULT blocks + - Thanks to Maksim Kochkin for the patch +- PHP_CodeSniffer_CLI::process() can now be passed an incomplete array of CLI values + - Missing values will be set to the CLI defaults + - Thanks to Maksim Kochkin for the patch + +### Fixed +- Fixed bug #20093 : Bug with ternary operator token +- Fixed bug #20097 : CLI.php throws error in php 5.2 +- Fixed bug #20100 : incorrect Function mysql() has been deprecated report +- Fixed bug #20119 : PHP warning: invalid argument to str_repeat() in SVN blame report with -s +- Fixed bug #20123 : PSR2 complains about an empty second statement in for-loop +- Fixed bug #20131 : PHP errors in svnblame report, if there are files not under version control +- Fixed bug #20133 : Allow "HG: hg_id" as value for @version tag + +## [1.4.8] - 2013-11-26 +### Changed +- Generic ScopeIndentSniff now allows for ignored tokens to be set via ruleset.xml files + - E.g., to ignore comments, override a property using: + - name="ignoreIndentationTokens" type="array" value="T_COMMENT,T_DOC_COMMENT" +- PSR2 standard now ignores comments when checking indentation rules +- Squiz OperatorSpacingSniff no longer throws errors for the ?: short ternary operator + - Thanks to Antoine Musso for the patch +- Comment parser now supports non-English characters when splitting comment lines into words + - Thanks to Nik Sun for the patch +- Exit statements are now recognised as valid closers for CASE and DEFAULT blocks + - Thanks to Maksim Kochkin for the patch +- PHP_CodeSniffer_CLI::process() can now be passed an incomplete array of CLI values + - Missing values will be set to the CLI defaults + - Thanks to Maksim Kochkin for the patch + +### Fixed +- Fixed bug #20097 : CLI.php throws error in php 5.2 +- Fixed bug #20100 : incorrect Function mysql() has been deprecated report +- Fixed bug #20119 : PHP warning: invalid argument to str_repeat() in SVN blame report with -s +- Fixed bug #20123 : PSR2 complains about an empty second statement in for-loop +- Fixed bug #20131 : PHP errors in svnblame report, if there are files not under version control +- Fixed bug #20133 : Allow "HG: hg_id" as value for @version tag + +## [1.5.0RC4] - 2013-09-26 +### Changed +- You can now restrict violations to individual sniff codes using the --sniffs command line argument + - Previously, this only restricted violations to an entire sniff and not individual messages + - If you have scripts calling PHP_CodeSniffer::process() or creating PHP_CodeSniffer_File objects, you must update your code + - The array of restrictions passed to PHP_CodeSniffer::process() must now be an array of sniff codes instead of class names + - The PHP_CodeSniffer_File::__construct() method now requires an array of restrictions to be passed +- Doc generation is now working again +- Progress information now shows the percentage complete at the end of each line +- Added report type --report=junit to show the error list in a JUnit compatible format + - Thanks to Oleg Lobach for the contribution +- Added support for the PHP 5.4 callable type hint +- Fixed problem where some file content could be ignored when checking STDIN +- Version information is now printed when installed via composer or run from a Git clone (request #20050) +- Added Squiz DisallowBooleanStatementSniff to ban boolean operators outside of control structure conditions +- The CSS tokenizer is now more reliable when encountering 'list' and 'break' strings +- Coding standard ignore comments can now appear instead doc blocks as well as inline comments + - Thanks to Stuart Langley for the patch +- Generic LineLengthSniff now ignores SVN URL and Head URL comments + - Thanks to Karl DeBisschop for the patch +- PEAR MultiLineConditionSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- PEAR MultiLineAssignmentSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- PEAR FunctionDeclarationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- Squiz SwitchDeclarationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- Squiz CSS IndentationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Hugo Fonseca for the patch +- Squiz and MySource File and Function comment sniffs now allow all tags and don't require a particular licence +- Squiz standard now allows lines to be 120 characters long before warning; up from 85 +- Squiz LowercaseStyleDefinitionSniff no longer throws errors for class names in nested style definitions +- Squiz ClassFileNameSniff no longer throws errors when checking STDIN +- Squiz CSS sniffs no longer generate errors for IE filters +- Squiz CSS IndentationSniff no longer sees comments as blank lines +- Squiz LogicalOperatorSpacingSniff now ignores whitespace at the end of a line +- Squiz.Scope.MethodScope.Missing error message now mentions 'visibility' instead of 'scope modifier' + - Thanks to Renat Akhmedyanov for the patch +- Added support for the PSR2 multi-line arguments errata +- The PSR2 standard no longer throws errors for additional spacing after a type hint +- PSR UseDeclarationSniff no longer throws errors for USE statements inside TRAITs + +### Fixed +- Fixed cases where code was incorrectly assigned the T_GOTO_LABEL token when used in a complex CASE condition +- Fixed bug #20026 : Check for multi-line arrays that should be single-line is slightly wrong + - Adds new error message for single-line arrays that end with a comma +- Fixed bug #20029 : ForbiddenFunction sniff incorrectly recognizes methods in USE clauses +- Fixed bug #20043 : Mis-interpretation of Foo::class +- Fixed bug #20044 : PSR1 camelCase check does not ignore leading underscores +- Fixed bug #20045 : Errors about indentation for closures with multi-line 'use' in functions +- Fixed bug #20051 : Undefined index: scope_opener / scope_closer + - Thanks to Anthon Pang for the patch + +## [1.4.7] - 2013-09-26 +### Changed +- Added report type --report=junit to show the error list in a JUnit compatible format + - Thanks to Oleg Lobach for the contribution +- Added support for the PHP 5.4 callable type hint +- Fixed problem where some file content could be ignored when checking STDIN +- Version information is now printed when installed via composer or run from a Git clone (request #20050) +- The CSS tokenizer is now more reliable when encountering 'list' and 'break' strings +- Coding standard ignore comments can now appear instead doc blocks as well as inline comments + - Thanks to Stuart Langley for the patch +- Generic LineLengthSniff now ignores SVN URL and Head URL comments + - Thanks to Karl DeBisschop for the patch +- PEAR MultiLineConditionSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- PEAR MultiLineAssignmentSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- PEAR FunctionDeclarationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- Squiz SwitchDeclarationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Szabolcs Sulik for the patch +- Squiz CSS IndentationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the 'indent' setting in a ruleset.xml file to change + - Thanks to Hugo Fonseca for the patch +- Squiz and MySource File and Function comment sniffs now allow all tags and don't require a particular licence +- Squiz LowercaseStyleDefinitionSniff no longer throws errors for class names in nested style definitions +- Squiz ClassFileNameSniff no longer throws errors when checking STDIN +- Squiz CSS sniffs no longer generate errors for IE filters +- Squiz CSS IndentationSniff no longer sees comments as blank lines +- Squiz LogicalOperatorSpacingSniff now ignores whitespace at the end of a line +- Squiz.Scope.MethodScope.Missing error message now mentions 'visibility' instead of 'scope modifier' + - Thanks to Renat Akhmedyanov for the patch +- Added support for the PSR2 multi-line arguments errata +- The PSR2 standard no longer throws errors for additional spacing after a type hint +- PSR UseDeclarationSniff no longer throws errors for USE statements inside TRAITs + +### Fixed +- Fixed bug #20026 : Check for multi-line arrays that should be single-line is slightly wrong + - Adds new error message for single-line arrays that end with a comma +- Fixed bug #20029 : ForbiddenFunction sniff incorrectly recognizes methods in USE clauses +- Fixed bug #20043 : Mis-interpretation of Foo::class +- Fixed bug #20044 : PSR1 camelCase check does not ignore leading underscores +- Fixed bug #20045 : Errors about indentation for closures with multi-line 'use' in functions + +## [1.5.0RC3] - 2013-07-25 +### Changed +- Added report type --report=json to show the error list and total counts for all checked files + - Thanks to Jeffrey Fisher for the contribution +- PHP_CodeSniffer::isCamelCaps now allows for acronyms at the start of a string if the strict flag is FALSE + - acronyms are defined as at least 2 uppercase characters in a row + - e.g., the following is now valid camel caps with strict set to FALSE: XMLParser +- The PHP tokenizer now tokenizes goto labels as T_GOTO_LABEL instead of T_STRING followed by T_COLON +- The JS tokenizer now has support for the T_THROW token +- Symlinked directories inside CodeSniffer/Standards and in ruleset.xml files are now supported + - Only available since PHP 5.2.11 and 5.3.1 + - Thanks to Maik Penz for the patch +- The JS tokenizer now correctly identifies T_INLINE_ELSE tokens instead of leaving them as T_COLON + - Thanks to Arnout Boks for the patch +- Explaining a standard (phpcs -e) that uses namespaces now works correctly +- Restricting a check to specific sniffs (phpcs --sniffs=...) now works correctly with namespaced sniffs + - Thanks to Maik Penz for the patch +- Docs added for the entire Generic standard, and many sniffs from other standards are now documented as well + - Thanks to Spencer Rinehart for the contribution +- Clearer error message for when the sniff class name does not match the directory structure +- Generated HTML docs now correctly show the open PHP tag in code comparison blocks +- Added Generic InlineHTMLSniff to ensure a file only contains PHP code +- Added Squiz ShorthandSizeSniff to check that CSS sizes are using shorthand notation only when 1 or 2 values are used +- Added Squiz ForbiddenStylesSniff to ban the use of some deprecated browser-specific styles +- Added Squiz NamedColoursSniff to ban the use of colour names +- PSR2 standard no longer enforces no whitespace between the closing parenthesis of a function call and the semicolon +- PSR2 ClassDeclarationSniff now ignores empty classes when checking the end brace position +- PSR2 SwitchDeclarationSniff no longer reports errors for empty lines between CASE statements +- PEAR ObjectOperatorIndentSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the indent setting in a ruleset.xml file to change + - Thanks to Andrey Mindubaev for the patch +- Squiz FileExtensionSniff now supports traits + - Thanks to Lucas Green for the patch +- Squiz ArrayDeclarationSniff no longer reports errors for no comma at the end of a line that contains a function call +- Squiz SwitchDeclarationSniff now supports T_CONTINUE and T_THROW as valid case/default breaking statements +- Squiz CommentedOutCodeSniff is now better at ignoring commented out HTML, XML and regular expressions +- Squiz DisallowComparisonAssignmentSniff no longer throws errors for the third expression in a FOR statement +- Squiz ColourDefinitionSniff no longer throws errors for some CSS class names +- Squiz ControlStructureSpacingSniff now supports all types of CASE/DEFAULT breaking statements +- Generic CallTimePassByReferenceSniff now reports errors for functions called using a variable + - Thanks to Maik Penz for the patch +- Generic ConstructorNameSniff no longer throws a notice for abstract constructors inside abstract classes + - Thanks to Spencer Rinehart for the patch +- Squiz ComparisonOperatorUsageSniff now checks inside elseif statements + - Thanks to Arnout Boks for the patch +- Squiz OperatorSpacingSniff now reports errors for no spacing around inline then and else tokens + - Thanks to Arnout Boks for the patch + +### Fixed +- Fixed bug #19811 : Comments not ignored in all cases in AbstractPatternSniff + - Thanks to Erik Wiffin for the patch +- Fixed bug #19892 : ELSE with no braces causes incorrect SWITCH break statement indentation error +- Fixed bug #19897 : Indenting warnings in templates not consistent +- Fixed bug #19908 : PEAR MultiLineCondition Does Not Apply elseif +- Fixed bug #19930 : option --report-file generate an empty file +- Fixed bug #19935 : notify-send reports do not vanish in gnome-shell + - Thanks to Christian Weiske for the patch +- Fixed bug #19944 : docblock squiz sniff "return void" trips over return in lambda function +- Fixed bug #19953 : PSR2 - Spaces before interface name for abstract class +- Fixed bug #19956 : phpcs warns for Type Hint missing Resource +- Fixed bug #19957 : Does not understand trait method aliasing +- Fixed bug #19968 : Permission denied on excluded directory +- Fixed bug #19969 : Sniffs with namespace not recognized in reports +- Fixed bug #19997 : Class names incorrectly detected as constants + +## [1.4.6] - 2013-07-25 +### Changed +- Added report type --report=json to show the error list and total counts for all checked files + - Thanks to Jeffrey Fisher for the contribution +- The JS tokenizer now has support for the T_THROW token +- Symlinked directories inside CodeSniffer/Standards and in ruleset.xml files are now supported + - Only available since PHP 5.2.11 and 5.3.1 + - Thanks to Maik Penz for the patch +- The JS tokenizer now correctly identifies T_INLINE_ELSE tokens instead of leaving them as T_COLON + - Thanks to Arnout Boks for the patch +- Explaining a standard (phpcs -e) that uses namespaces now works correctly +- Restricting a check to specific sniffs (phpcs --sniffs=...) now works correctly with namespaced sniffs + - Thanks to Maik Penz for the patch +- Docs added for the entire Generic standard, and many sniffs from other standards are now documented as well + - Thanks to Spencer Rinehart for the contribution +- Clearer error message for when the sniff class name does not match the directory structure +- Generated HTML docs now correctly show the open PHP tag in code comparison blocks +- Added Generic InlineHTMLSniff to ensure a file only contains PHP code +- Added Squiz ShorthandSizeSniff to check that CSS sizes are using shorthand notation only when 1 or 2 values are used +- Added Squiz ForbiddenStylesSniff to ban the use of some deprecated browser-specific styles +- Added Squiz NamedColoursSniff to ban the use of colour names +- PSR2 standard no longer enforces no whitespace between the closing parenthesis of a function call and the semicolon +- PSR2 ClassDeclarationSniff now ignores empty classes when checking the end brace position +- PSR2 SwitchDeclarationSniff no longer reports errors for empty lines between CASE statements +- PEAR ObjectOperatorIndentSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the indent setting in a ruleset.xml file to change + - Thanks to Andrey Mindubaev for the patch +- Squiz FileExtensionSniff now supports traits + - Thanks to Lucas Green for the patch +- Squiz ArrayDeclarationSniff no longer reports errors for no comma at the end of a line that contains a function call +- Squiz SwitchDeclarationSniff now supports T_CONTINUE and T_THROW as valid case/default breaking statements +- Squiz CommentedOutCodeSniff is now better at ignoring commented out HTML, XML and regular expressions +- Squiz DisallowComparisonAssignmentSniff no longer throws errors for the third expression in a FOR statement +- Squiz ColourDefinitionSniff no longer throws errors for some CSS class names +- Squiz ControlStructureSpacingSniff now supports all types of CASE/DEFAULT breaking statements +- Generic CallTimePassByReferenceSniff now reports errors for functions called using a variable + - Thanks to Maik Penz for the patch +- Generic ConstructorNameSniff no longer throws a notice for abstract constructors inside abstract classes + - Thanks to Spencer Rinehart for the patch +- Squiz ComparisonOperatorUsageSniff now checks inside elseif statements + - Thanks to Arnout Boks for the patch +- Squiz OperatorSpacingSniff now reports errors for no spacing around inline then and else tokens + - Thanks to Arnout Boks for the patch + +### Fixed +- Fixed bug #19811 : Comments not ignored in all cases in AbstractPatternSniff + - Thanks to Erik Wiffin for the patch +- Fixed bug #19892 : ELSE with no braces causes incorrect SWITCH break statement indentation error +- Fixed bug #19897 : Indenting warnings in templates not consistent +- Fixed bug #19908 : PEAR MultiLineCondition Does Not Apply elseif +- Fixed bug #19913 : Running phpcs in interactive mode causes warnings + - Thanks to Harald Franndorfer for the patch +- Fixed bug #19935 : notify-send reports do not vanish in gnome-shell + - Thanks to Christian Weiske for the patch +- Fixed bug #19944 : docblock squiz sniff "return void" trips over return in lambda function +- Fixed bug #19953 : PSR2 - Spaces before interface name for abstract class +- Fixed bug #19956 : phpcs warns for Type Hint missing Resource +- Fixed bug #19957 : Does not understand trait method aliasing +- Fixed bug #19968 : Permission denied on excluded directory +- Fixed bug #19969 : Sniffs with namespace not recognized in reports +- Fixed bug #19997 : Class names incorrectly detected as constants + +## [1.5.0RC2] - 2013-04-04 +### Changed +- Ruleset processing has been rewritten to be more predictable + - Provides much better support for relative paths inside ruleset files + - May mean that sniffs that were previously ignored are now being included when importing external rulesets + - Ruleset processing output can be seen by using the -vv command line argument + - Internal sniff registering functions have all changed, so please review custom scripts +- You can now pass multiple coding standards on the command line, comma separated (request #19144) + - Works with built-in or custom standards and rulesets, or a mix of both +- You can now exclude directories or whole standards in a ruleset XML file (request #19731) + - e.g., exclude "Generic.Commenting" or just "Generic" + - You can also pass in a path to a directory instead, if you know it +- Added Generic LowerCaseKeywordSniff to ensure all PHP keywords are defined in lowercase + - The PSR2 and Squiz standards now use this sniff +- Added Generic SAPIUsageSniff to ensure the PHP_SAPI constant is used instead of php_sapi_name() (request #19863) +- Squiz FunctionSpacingSniff now has a setting to specify how many lines there should between functions (request #19843) + - Default remains at 2 + - Override the "spacing" setting in a ruleset.xml file to change +- Squiz LowercasePHPFunctionSniff no longer throws errors for the limited set of PHP keywords it was checking + - Add a rule for Generic.PHP.LowerCaseKeyword to your ruleset to replicate this functionality +- Added support for the PHP 5.4 T_CALLABLE token so it can be used in lower PHP versions +- Generic EndFileNoNewlineSniff now supports checking of CSS and JS files +- PSR2 SwitchDeclarationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the indent setting in a ruleset.xml file to change + - Thanks to Asher Snyder for the patch +- Generic ScopeIndentSniff now has a setting to specify a list of tokens that should be ignored + - The first token on the line is checked and the whole line is ignored if the token is in the array + - Thanks to Eloy Lafuente for the patch +- Squiz LowercaseClassKeywordsSniff now checks for the TRAIT keyword + - Thanks to Anthon Pang for the patch +- If you create your own PHP_CodeSniffer object, PHPCS will no longer exit when an unknown argument is found + - This allows you to create wrapper scripts for PHPCS more easily +- PSR2 MethodDeclarationSniff no longer generates a notice for methods named "_" + - Thanks to Bart S for the patch +- Squiz BlockCommentSniff no longer reports that a blank line between a scope closer and block comment is invalid +- Generic DuplicateClassNameSniff no longer reports an invalid error if multiple PHP open tags exist in a file +- Generic DuplicateClassNameSniff no longer reports duplicate errors if multiple PHP open tags exist in a file + +### Fixed +- Fixed bug #19819 : Freeze with syntax error in use statement +- Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff +- Fixed bug #19859 : CodeSniffer::setIgnorePatterns API changed +- Fixed bug #19871 : findExtendedClassName doesn't return FQCN on namespaced classes +- Fixed bug #19879 : bitwise and operator interpreted as reference by value + +## [1.4.5] - 2013-04-04 +### Changed +- Added Generic LowerCaseKeywordSniff to ensure all PHP keywords are defined in lowercase + - The PSR2 and Squiz standards now use this sniff +- Added Generic SAPIUsageSniff to ensure the PHP_SAPI constant is used instead of php_sapi_name() (request #19863) +- Squiz FunctionSpacingSniff now has a setting to specify how many lines there should between functions (request #19843) + - Default remains at 2 + - Override the "spacing" setting in a ruleset.xml file to change +- Squiz LowercasePHPFunctionSniff no longer throws errors for the limited set of PHP keywords it was checking + - Add a rule for Generic.PHP.LowerCaseKeyword to your ruleset to replicate this functionality +- Added support for the PHP 5.4 T_CALLABLE token so it can be used in lower PHP versions +- Generic EndFileNoNewlineSniff now supports checking of CSS and JS files +- PSR2 SwitchDeclarationSniff now has a setting to specify how many spaces code should be indented + - Default remains at 4; override the indent setting in a ruleset.xml file to change + - Thanks to Asher Snyder for the patch +- Generic ScopeIndentSniff now has a setting to specify a list of tokens that should be ignored + - The first token on the line is checked and the whole line is ignored if the token is in the array + - Thanks to Eloy Lafuente for the patch +- Squiz LowercaseClassKeywordsSniff now checks for the TRAIT keyword + - Thanks to Anthon Pang for the patch +- If you create your own PHP_CodeSniffer object, PHPCS will no longer exit when an unknown argument is found + - This allows you to create wrapper scripts for PHPCS more easily +- PSR2 MethodDeclarationSniff no longer generates a notice for methods named "_" + - Thanks to Bart S for the patch +- Squiz BlockCommentSniff no longer reports that a blank line between a scope closer and block comment is invalid +- Generic DuplicateClassNameSniff no longer reports an invalid error if multiple PHP open tags exist in a file +- Generic DuplicateClassNameSniff no longer reports duplicate errors if multiple PHP open tags exist in a file + +### Fixed +- Fixed bug #19819 : Freeze with syntax error in use statement +- Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff +- Fixed bug #19859 : CodeSniffer::setIgnorePatterns API changed +- Fixed bug #19871 : findExtendedClassName doesn't return FQCN on namespaced classes +- Fixed bug #19879 : bitwise and operator interpreted as reference by value + +## [1.5.0RC1] - 2013-02-08 +### Changed +- Reports have been completely rewritten to consume far less memory + - Each report is incrementally written to the file system during a run and then printed out when the run ends + - There is no longer a need to keep the list of errors and warnings in memory during a run +- Multi-file sniff support has been removed because they are too memory intensive + - If you have a custom multi-file sniff, you can convert it into a standard sniff quite easily + - See CodeSniffer/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php for an example + +## [1.4.4] - 2013-02-07 +### Changed +- Ignored lines no longer cause the summary report to show incorrect error and warning counts + - Thanks to Bert Van Hauwaert for the patch +- Added Generic CSSLintSniff to run CSSLint over a CSS file and report warnings + - Set full command to run CSSLint using phpcs --config-set csslint_path /path/to/csslint + - Thanks to Roman Levishchenko for the contribution +- Added PSR2 ControlStructureSpacingSniff to ensure there are no spaces before and after parenthesis in control structures + - Fixes bug #19732 : PSR2: some control structures errors not reported +- Squiz commenting sniffs now support non-English characters when checking for capital letters + - Thanks to Roman Levishchenko for the patch +- Generic EndFileNewlineSniff now supports JS and CSS files + - Thanks to Denis Ryabkov for the patch +- PSR1 SideEffectsSniff no longer reports constant declarations as side effects +- Notifysend report now supports notify-send versions before 0.7.3 + - Thanks to Ken Guest for the patch +- PEAR and Squiz FunctionCommentSniffs no longer report errors for misaligned argument comments when they are blank + - Thanks to Thomas Peterson for the patch +- Squiz FunctionDeclarationArgumentSpacingSniff now works correctly for equalsSpacing values greater than 0 + - Thanks to Klaus Purer for the patch +- Squiz SuperfluousWhitespaceSniff no longer throws errors for CSS files with no newline at the end +- Squiz SuperfluousWhitespaceSniff now allows a single newline at the end of JS and CSS files + +### Fixed +- Fixed bug #19755 : Token of T_CLASS type has no scope_opener and scope_closer keys +- Fixed bug #19759 : Squiz.PHP.NonExecutableCode fails for return function()... +- Fixed bug #19763 : Use statements for traits not recognised correctly for PSR2 code style +- Fixed bug #19764 : Instead of for traits throws uppercase constant name errors +- Fixed bug #19772 : PSR2_Sniffs_Namespaces_UseDeclarationSniff does not properly recognize last use +- Fixed bug #19775 : False positive in NonExecutableCode sniff when not using curly braces +- Fixed bug #19782 : Invalid found size functions in loop when using object operator +- Fixed bug #19799 : config folder is not created automatically +- Fixed bug #19804 : JS Tokenizer wrong /**/ parsing + +## [1.4.3] - 2012-12-04 +### Changed +- Added support for the PHP 5.5 T_FINALLY token to detect try/catch/finally statements +- Added empty CodeSniffer.conf to enable config settings for Composer installs +- Added Generic EndFileNoNewlineSniff to ensure there is no newline at the end of a file +- Autoloader can now load PSR-0 compliant classes + - Thanks to Maik Penz for the patch +- Squiz NonExecutableCodeSniff no longer throws error for multi-line RETURNs inside CASE statements + - Thanks to Marc Ypes for the patch +- Squiz OperatorSpacingSniff no longer reports errors for negative numbers inside inline THEN statements + - Thanks to Klaus Purer for the patch +- Squiz OperatorSpacingSniff no longer reports errors for the assignment of operations involving negative numbers +- Squiz SelfMemberReferenceSniff can no longer get into an infinite loop when checking a static call with a namespace + - Thanks to Andy Grunwald for the patch + +### Fixed +- Fixed bug #19699 : Generic.Files.LineLength giving false positives when tab-width is used +- Fixed bug #19726 : Wrong number of spaces expected after instanceof static +- Fixed bug #19727 : PSR2: no error reported when using } elseif { + +## [1.4.2] - 2012-11-09 +### Changed +- PHP_CodeSniffer can now be installed using Composer + - Require squizlabs/php_codesniffer in your composer.json file + - Thanks to Rob Bast, Stephen Rees-Carter, Stefano Kowalke and Ivan Habunek for help with this +- Squiz BlockCommentSniff and InlineCommentSniff no longer report errors for trait block comments +- Squiz SelfMemberReferenceSniff now supports namespaces + - Thanks to Andy Grunwald for the patch +- Squiz FileCommentSniff now uses tag names inside the error codes for many messages + - This allows you to exclude specific missing, out of order etc., tags +- Squiz SuperfluousWhitespaceSniff now has an option to ignore blank lines + - This will stop errors being reported for lines that contain only whitespace + - Set the ignoreBlankLines property to TRUE in your ruleset.xml file to enable this +- PSR2 no longer reports errors for whitespace at the end of blank lines + +### Fixed +- Fixed gitblame report not working on Windows + - Thanks to Rogerio Prado de Jesus +- Fixed an incorrect error in Squiz OperatorSpacingSniff for default values inside a closure definition +- Fixed bug #19691 : SubversionPropertiesSniff fails to find missing properties + - Thanks to Kevin Winahradsky for the patch +- Fixed bug #19692 : DisallowMultipleAssignments is triggered by a closure +- Fixed bug #19693 : exclude-patterns no longer work on specific messages +- Fixed bug #19694 : Squiz.PHP.LowercasePHPFunctions incorrectly matches return by ref functions + +## [1.4.1] - 2012-11-02 +### Changed +- All ignore patterns have been reverted to being checked against the absolute path of a file + - Patterns can be specified to be relative in a ruleset.xml file, but nowhere else + - e.g., [exclude-pattern type="relative"]^tests/*[/exclude-pattern] (with angle brackets, not square brackets) +- Added support for PHP tokenizing of T_INLINE_ELSE colons, so this token type is now available + - Custom sniffs that rely on looking for T_COLON tokens inside inline if statements must be changed to use the new token + - Fixes bug #19666 : PSR1.Files.SideEffects throws a notice Undefined index: scope_closer +- Messages can now be changed from errors to warnings (and vice versa) inside ruleset.xml files + - As you would with "message" and "severity", specify a "type" tag under a "rule" tag and set the value to "error" or "warning" +- PHP_CodeSniffer will now generate a warning on files that it detects have mixed line endings + - This warning has the code Internal.LineEndings.Mixed and can be overridden in a ruleset.xml file + - Thanks to Vit Brunner for help with this +- Sniffs inside PHP 5.3 namespaces are now supported, along with the existing underscore-style emulated namespaces + - For example: namespace MyStandard\Sniffs\Arrays; class ArrayDeclarationSniff implements \PHP_CodeSniffer_Sniff { ... + - Thanks to Till Klampaeckel for the patch +- Generic DuplicateClassNameSniff is no longer a multi-file sniff, so it won't max out your memory + - Multi-file sniff support should be considered deprecated as standard sniffs can now do the same thing +- Added Generic DisallowSpaceIndent to check that files are indented using tabs +- Added Generic OneClassPerFileSniff to check that only one class is defined in each file + - Thanks to Andy Grunwald for the contribution +- Added Generic OneInterfacePerFileSniff to check that only one interface is defined in each file + - Thanks to Andy Grunwald for the contribution +- Added Generic LowercasedFilenameSniff to check that filenames are lowercase + - Thanks to Andy Grunwald for the contribution +- Added Generic ClosingPHPTagSniff to check that each open PHP tag has a corresponding close tag + - Thanks to Andy Grunwald for the contribution +- Added Generic CharacterBeforePHPOpeningTagSniff to check that the open PHP tag is the first content in a file + - Thanks to Andy Grunwald for the contribution +- Fixed incorrect errors in Squiz OperatorBracketSniff and OperatorSpacingSniff for negative numbers in CASE statements + - Thanks to Arnout Boks for the patch +- Generic CamelCapsFunctionNameSniff no longer enforces exact case matching for PHP magic methods +- Generic CamelCapsFunctionNameSniff no longer throws errors for overridden SOAPClient methods prefixed with double underscores + - Thanks to Dorian Villet for the patch +- PEAR ValidFunctionNameSniff now supports traits +- PSR1 ClassDeclarationSniff no longer throws an error for non-namespaced code if PHP version is less than 5.3.0 + +### Fixed +- Fixed bug #19616 : Nested switches cause false error in PSR2 +- Fixed bug #19629 : PSR2 error for inline comments on multi-line argument lists +- Fixed bug #19644 : Alternative syntax, e.g. if/endif triggers Inline Control Structure error +- Fixed bug #19655 : Closures reporting as multi-line when they are not +- Fixed bug #19675 : Improper indent of nested anonymous function bodies in a call +- Fixed bug #19685 : PSR2 catch-22 with empty third statement in for loop +- Fixed bug #19687 : Anonymous functions inside arrays marked as indented incorrectly in PSR2 + +## [1.4.0] - 2012-09-26 +### Changed +- Added PSR1 and PSR2 coding standards that can be used to check your code against these guidelines +- PHP 5.4 short array syntax is now detected and tokens are assigned to the open and close characters + - New tokens are T_OPEN_SHORT_ARRAY and T_CLOSE_SHORT_ARRAY as PHP does not define its own +- Added the ability to explain a coding standard by listing the sniffs that it includes + - The sniff list includes all imported and native sniffs + - Explain a standard by using the -e and --standard=[standard] command line arguments + - E.g., phpcs -e --standard=Squiz + - Thanks to Ben Selby for the idea +- Added report to show results using notify-send + - Use --report=notifysend to generate the report + - Thanks to Christian Weiske for the contribution +- The JS tokenizer now recognises RETURN as a valid closer for CASE and DEFAULT inside switch statements +- AbstractPatternSniff now sets the ignoreComments option using a public var rather than through the constructor + - This allows the setting to be overwritten in ruleset.xml files + - Old method remains for backwards compatibility +- Generic LowerCaseConstantSniff and UpperCaseConstantSniff no longer report errors on classes named True, False or Null +- PEAR ValidFunctionNameSniff no longer enforces exact case matching for PHP magic methods +- Squiz SwitchDeclarationSniff now allows RETURN statements to close a CASE or DEFAULT statement +- Squiz BlockCommentSniff now correctly reports an error for blank lines before blocks at the start of a control structure + +### Fixed +- Fixed a PHP notice generated when loading custom array settings from a ruleset.xml file +- Fixed bug #17908 : CodeSniffer does not recognise optional @params + - Thanks to Pete Walker for the patch +- Fixed bug #19538 : Function indentation code sniffer checks inside short arrays +- Fixed bug #19565 : Non-Executable Code Sniff Broken for Case Statements with both return and break +- Fixed bug #19612 : Invalid @package suggestion + +## [1.3.6] - 2012-08-08 +### Changed +- Memory usage has been dramatically reduced when using the summary report + - Reduced memory is only available when displaying a single summary report to the screen + - PHP_CodeSniffer will not generate any messages in this case, storing only error counts instead + - Impact is most notable with very high error and warning counts +- Significantly improved the performance of Squiz NonExecutableCodeSniff +- Ignore patterns now check the relative path of a file based on the dir being checked + - Allows ignore patterns to become more generic as the path to the code is no longer included when checking + - Thanks to Kristof Coomans for the patch +- Sniff settings can now be changed by specifying a special comment format inside a file + - e.g., // @codingStandardsChangeSetting PEAR.Functions.FunctionCallSignature allowMultipleArguments false + - If you change a setting, don't forget to change it back +- Added Generic EndFileNewlineSniff to ensure PHP files end with a newline character +- PEAR FunctionCallSignatureSniff now includes a setting to force one argument per line in multi-line calls + - Set allowMultipleArguments to false +- Squiz standard now enforces one argument per line in multi-line function calls +- Squiz FunctionDeclarationArgumentSpacingSniff now supports closures +- Squiz OperatorSpacingSniff no longer throws an error for negative values inside an inline THEN statement + - Thanks to Klaus Purer for the patch +- Squiz FunctionCommentSniff now throws an error for not closing a comment with */ + - Thanks to Klaus Purer for the patch +- Summary report no longer shows two lines of PHP_Timer output when showing sources + +### Fixed +- Fixed undefined variable error in PEAR FunctionCallSignatureSniff for lines with no indent +- Fixed bug #19502 : Generic.Files.LineEndingsSniff fails if no new-lines in file +- Fixed bug #19508 : switch+return: Closing brace indented incorrectly +- Fixed bug #19532 : The PSR-2 standard don't recognize Null in class names +- Fixed bug #19546 : Error thrown for __call() method in traits + +## [1.3.5] - 2012-07-12 +### Changed +- Added Generic CamelCapsFunctionNameSniff to just check if function and method names use camel caps + - Does not allow underscore prefixes for private/protected methods + - Defaults to strict checking, where two uppercase characters can not be next to each other + - Strict checking can be disabled in a ruleset.xml file +- Squiz FunctionDeclarationArgumentSpacing now has a setting to specify how many spaces should surround equals signs + - Default remains at 0 + - Override the equalsSpacing setting in a ruleset.xml file to change +- Squiz ClassDeclarationSniff now throws errors for > 1 space before extends/implements class name with ns separator +- Squiz standard now warns about deprecated functions using Generic DeprecatedFunctionsSniff +- PEAR FunctionDeclarationSniff now reports an error for multiple spaces after the FUNCTION keyword and around USE +- PEAR FunctionDeclarationSniff now supports closures +- Squiz MultiLineFunctionDeclarationSniff now supports closures +- Exclude rules written for Unix systems will now work correctly on Windows + - Thanks to Walter Tamboer for the patch +- The PHP tokenizer now recognises T_RETURN as a valid closer for T_CASE and T_DEFAULT inside switch statements + +### Fixed +- Fixed duplicate message codes in Generic OpeningFunctionBraceKernighanRitchieSniff +- Fixed bug #18651 : PHPunit Test cases for custom standards are not working on Windows +- Fixed bug #19416 : Shorthand arrays cause bracket spacing errors +- Fixed bug #19421 : phpcs doesn't recognize ${x} as equivalent to $x +- Fixed bug #19428 : PHPCS Report "hgblame" doesn't support windows paths + - Thanks to Justin Rovang for the patch +- Fixed bug #19448 : Problem with detecting remote standards +- Fixed bug #19463 : Anonymous functions incorrectly being flagged by NonExecutableCodeSniff +- Fixed bug #19469 : PHP_CodeSniffer_File::getMemberProperties() sets wrong scope +- Fixed bug #19471 : phpcs on Windows, when using Zend standard, doesn't catch problems + - Thanks to Ivan Habunek for the patch +- Fixed bug #19478 : Incorrect indent detection in PEAR standard + - Thanks to Shane Auckland for the patch +- Fixed bug #19483 : Blame Reports fail with space in directory name + +## [1.3.4] - 2012-05-17 +### Changed +- Added missing package.xml entries for new Generic FixmeSniff + - Thanks to Jaroslav Hanslík for the patch +- Expected indents for PEAR ScopeClosingBraceSniff and FunctionCallSignatureSniff can now be set in ruleset files + - Both sniffs use a variable called "indent" + - Thanks to Thomas Despoix for the patch +- Standards designed to be installed in the PHPCS Standards dir will now work outside this dir as well + - In particular, allows the Drupal CS to work without needing to symlink it into the PHPCS install + - Thanks to Peter Philipp for the patch +- Rule references for standards, directories and specific sniffs can now be relative in ruleset.xml files + - For example: ref="../MyStandard/Sniffs/Commenting/DisallowHashCommentsSniff.php" +- Symlinked standards now work correctly, allowing aliasing of installed standards (request #19417) + - Thanks to Tom Klingenberg for the patch +- Squiz ObjectInstantiationSniff now allows objects to be returned without assigning them to a variable +- Added Squiz.Commenting.FileComment.MissingShort error message for file comments that only contains tags + - Also stops undefined index errors being generated for these comments +- Debug option -vv now shows tokenizer status for CSS files +- Added support for new gjslint error formats + - Thanks to Meck for the patch +- Generic ScopeIndentSniff now allows comment indents to not be exact even if the exact flag is set + - The start of the comment is still checked for exact indentation as normal +- Fixed an issue in AbstractPatternSniff where comments were not being ignored in some cases +- Fixed an issue in Zend ClosingTagSniff where the closing tag was not always being detected correctly + - Thanks to Jonathan Robson for the patch +- Fixed an issue in Generic FunctionCallArgumentSpacingSniff where closures could cause incorrect errors +- Fixed an issue in Generic UpperCaseConstantNameSniff where errors were incorrectly reported on goto statements + - Thanks to Tom Klingenberg for the patch +- PEAR FileCommentSniff and ClassCommentSniff now support author emails with a single character in the local part + - E.g., a@me.com + - Thanks to Denis Shapkin for the patch + +### Fixed +- Fixed bug #19290 : Generic indent sniffer fails for anonymous functions +- Fixed bug #19324 : Setting show_warnings configuration option does not work +- Fixed bug #19354 : Not recognizing references passed to method +- Fixed bug #19361 : CSS tokenizer generates errors when PHP embedded in CSS file +- Fixed bug #19374 : HEREDOC/NOWDOC Indentation problems +- Fixed bug #19381 : traits and indentations in traits are not handled properly +- Fixed bug #19394 : Notice in NonExecutableCodeSniff +- Fixed bug #19402 : Syntax error when executing phpcs on Windows with parens in PHP path + - Thanks to Tom Klingenberg for the patch +- Fixed bug #19411 : magic method error on __construct() + - The fix required a rewrite of AbstractScopeSniff, so please test any sniffs that extend this class +- Fixed bug #19412 : Incorrect error about assigning objects to variables when inside inline IF +- Fixed bug #19413 : php_cs thinks I haven't used a parameter when I have +- Fixed bug #19414 : php_cs seems to not track variables correctly in heredocs + +## [1.3.3] - 2012-02-07 +### Changed +- Added new Generic FixmeSniff that shows error messages for all FIXME comments left in your code + - Thanks to Sam Graham for the contribution +- The maxPercentage setting in the Squiz CommentedOutCodeSniff can now be overridden in a ruleset.xml file + - Thanks to Volker Dusch for the patch +- The Checkstyle and XML reports now use XMLWriter + - Only change in output is that empty file tags are no longer produced for files with no violations + - Thanks to Sebastian Bergmann for the patch +- Added PHP_CodeSniffer_Tokens::$bracketTokens to give sniff writers fast access to open and close bracket tokens +- Fixed an issue in AbstractPatternSniff where EOL tokens were not being correctly checked in some cases +- PHP_CodeSniffer_File::getTokensAsString() now detects incorrect length value (request #19313) + +### Fixed +- Fixed bug #19114 : CodeSniffer checks extension even for single file +- Fixed bug #19171 : Show sniff codes option is ignored by some report types + - Thanks to Dominic Scheirlinck for the patch +- Fixed bug #19188 : Lots of PHP Notices when analyzing the Symfony framework + - First issue was list-style.. lines in CSS files not properly adjusting open/close bracket positions + - Second issue was notices caused by bug #19137 +- Fixed bug #19208 : UpperCaseConstantName reports class members + - Was also a problem with LowerCaseConstantName as well +- Fixed bug #19256 : T_DOC_COMMENT in CSS files breaks ClassDefinitionNameSpacingSniff + - Thanks to Klaus Purer for the patch +- Fixed bug #19264 : Squiz.PHP.NonExecutableCode does not handle RETURN in CASE without BREAK +- Fixed bug #19270 : DuplicateClassName does not handle namespaces correctly +- Fixed bug #19283 : CSS @media rules cause false positives + - Thanks to Klaus Purer for the patch + +## [1.3.2] - 2011-12-01 +### Changed +- Added Generic JSHintSniff to run jshint.js over a JS file and report warnings + - Set jshint path using phpcs --config-set jshint_path /path/to/jshint-rhino.js + - Set rhino path using phpcs --config-set rhino_path /path/to/rhino + - Thanks to Alexander Weiß for the contribution +- Nowdocs are now tokenized using PHP_CodeSniffer specific T_NOWDOC tokens for easier identification +- Generic UpperCaseConstantNameSniff no longer throws errors for namespaces + - Thanks to Jaroslav Hanslík for the patch +- Squiz NonExecutableCodeSniff now detects code after thrown exceptions + - Thanks to Jaroslav Hanslík for the patch +- Squiz OperatorSpacingSniff now ignores references + - Thanks to Jaroslav Hanslík for the patch +- Squiz FunctionCommentSniff now reports a missing function comment if it finds a standard code comment instead +- Squiz FunctionCommentThrownTagSniff no longer reports errors if it can't find a function comment + +### Fixed +- Fixed unit tests not running under Windows + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #18964 : "$stackPtr must be of type T_VARIABLE" on heredocs and nowdocs +- Fixed bug #18973 : phpcs is looking for variables in a nowdoc +- Fixed bug #18974 : Blank line causes "Multi-line function call not indented correctly" + - Adds new error message to ban empty lines in multi-line function calls +- Fixed bug #18975 : "Closing parenthesis must be on a line by itself" also causes indentation error + +## 1.3.1 - 2011-11-03 +### Changed +- All report file command line arguments now work with relative paths (request #17240) +- The extensions command line argument now supports multi-part file extensions (request #17227) +- Added report type --report=hgblame to show number of errors/warnings committed by authors in a Mercurial repository + - Has the same functionality as the svnblame report + - Thanks to Ben Selby for the patch +- Added T_BACKTICK token type to make detection of backticks easier (request #18799) +- Added pattern matching support to Generic ForbiddenFunctionsSniff + - If you are extending it and overriding register() or addError() you will need to review your sniff +- Namespaces are now recognised as scope openers, although they do not require braces (request #18043) +- Added new ByteOrderMarkSniff to Generic standard (request #18194) + - Throws an error if a byte order mark is found in any PHP file + - Thanks to Piotr Karas for the contribution +- PHP_Timer output is no longer included in reports when being written to a file (request #18252) + - Also now shown for all report types if nothing is being printed to the screen +- Generic DeprecatedFunctionSniff now reports functions as deprecated and not simply forbidden (request #18288) +- PHPCS now accepts file contents from STDIN (request #18447) + - Example usage: cat temp.php | phpcs [options] -OR- phpcs [options] < temp.php + - Not every sniff will work correctly due to the lack of a valid file path +- PHP_CodeSniffer_Exception no longer extends PEAR_Exception (request #18483) + - PEAR_Exception added a requirement that PEAR had to be installed + - PHP_CodeSniffer is not used as a library, so unlikely to have any impact +- PEAR FileCommentSniff now allows GIT IDs in the version tag (request #14874) +- AbstractVariableSniff now supports heredocs + - Also includes some variable detection fixes + - Thanks to Sam Graham for the patch +- Squiz FileCommentSniff now enforces rule that package names cannot start with the word Squiz +- MySource AssignThisSniff now allows "this" to be assigned to the private var _self +- PEAR ClassDeclaration sniff now supports indentation checks when using the alternate namespace syntax + - PEAR.Classes.ClassDeclaration.SpaceBeforeBrace message now contains 2 variables instead of 1 + - Sniff allows overriding of the default indent level, which is set to 4 + - Fixes bug #18933 : Alternative namespace declaration syntax confuses scope sniffs + +### Fixed +- Fixed issue in Squiz FileCommentSniff where suggested package name was the same as the incorrect package name +- Fixed some issues with Squiz ArrayDeclarationSniff when using function calls in array values +- Fixed doc generation so it actually works again + - Also now works when being run from an SVN checkout as well as when installed as a PEAR package + - Should fix bug #18949 : Call to private method from static +- Fixed bug #18465 : "self::" does not work in lambda functions + - Also corrects conversion of T_FUNCTION tokens to T_CLOSURE, which was not fixing token condition arrays +- Fixed bug #18543 : CSS Tokenizer deletes too many # +- Fixed bug #18624 : @throws namespace problem + - Thanks to Gavin Davies for the patch +- Fixed bug #18628 : Generic.Files.LineLength gives incorrect results with Windows line-endings +- Fixed bug #18633 : CSS Tokenizer doesn't replace T_LIST tokens inside some styles +- Fixed bug #18657 : anonymous functions wrongly indented +- Fixed bug #18670 : UpperCaseConstantNameSniff fails on dynamic retrieval of class constant +- Fixed bug #18709 : Code sniffer sniffs file if even if it's in --ignore + - Thanks to Artem Lopata for the patch +- Fixed bug #18762 : Incorrect handling of define and constant in UpperCaseConstantNameSniff + - Thanks to Thomas Baker for the patch +- Fixed bug #18769 : CSS Tokenizer doesn't replace T_BREAK tokens inside some styles +- Fixed bug #18835 : Unreachable errors of inline returns of closure functions + - Thanks to Patrick Schmidt for the patch +- Fixed bug #18839 : Fix miscount of warnings in AbstractSniffUnitTest.php + - Thanks to Sam Graham for the patch +- Fixed bug #18844 : Generic_Sniffs_CodeAnalysis_UnusedFunctionParameterSniff with empty body + - Thanks to Dmitri Medvedev for the patch +- Fixed bug #18847 : Running Squiz_Sniffs_Classes_ClassDeclarationSniff results in PHP notice +- Fixed bug #18868 : jslint+rhino: errors/warnings not detected + - Thanks to Christian Weiske for the patch +- Fixed bug #18879 : phpcs-svn-pre-commit requires escapeshellarg + - Thanks to Bjorn Katuin for the patch +- Fixed bug #18951 : weird behaviour with closures and multi-line use () params + +## 1.3.0 - 2011-03-17 +### Changed +- Add a new token T_CLOSURE that replaces T_FUNCTION if the function keyword is anonymous +- Many Squiz sniffs no longer report errors when checking closures; they are now ignored +- Fixed some error messages in PEAR MultiLineConditionSniff that were not using placeholders for message data +- AbstractVariableSniff now correctly finds variable names wrapped with curly braces inside double quoted strings +- PEAR FunctionDeclarationSniff now ignores arrays in argument default values when checking multi-line declarations + +### Fixed +- Fixed bug #18200 : Using custom named ruleset file as standard no longer works +- Fixed bug #18196 : PEAR MultiLineCondition.SpaceBeforeOpenBrace not consistent with newline chars +- Fixed bug #18204 : FunctionCommentThrowTag picks wrong exception type when throwing function call +- Fixed bug #18222 : Add __invoke method to PEAR standard +- Fixed bug #18235 : Invalid error generation in Squiz.Commenting.FunctionCommentThrowTag +- Fixed bug #18250 : --standard with relative path skips Standards' "implicit" sniffs +- Fixed bug #18274 : Multi-line IF and function call indent rules conflict +- Fixed bug #18282 : Squiz doesn't handle final keyword before function comments + - Thanks to Dave Perrett for the patch +- Fixed bug #18336 : Function isUnderscoreName gives php notices + +## 1.3.0RC2 - 2011-01-14 +### Changed +- You can now print multiple reports for each run and print each to the screen or a file (request #12434) + - Format is --report-[report][=file] (e.g., --report-xml=out.xml) + - Printing to screen is done by leaving [file] empty (e.g., --report-xml) + - Multiple reports can be specified in this way (e.g., --report-summary --report-xml=out.xml) + - The standard --report and --report-file command line arguments are unchanged +- Added -d command line argument to set php.ini settings while running (request #17244) + - Usage is: phpcs -d memory_limit=32M -d ... + - Thanks to Ben Selby for the patch +- Added -p command line argument to show progress during a run + - Dot means pass, E means errors found, W means only warnings found and S means skipped file + - Particularly good for runs where you are checking more than 100 files + - Enable by default with --config-set show_progress 1 + - Will not print anything if you are already printing verbose output + - This has caused a big change in the way PHP_CodeSniffer processes files (API changes around processing) +- You can now add exclude rules for individual sniffs or error messages (request #17903) + - Only available when using a ruleset.xml file to specify rules + - Uses the same exclude-pattern tags as normal but allows them inside rule tags +- Using the -vvv option will now print a list of sniffs executed for each file and how long they took to process +- Added Generic ClosureLinterSniff to run Google's gjslint over your JS files +- The XML and CSV reports now include the severity of the error (request #18165) + - The Severity column in the CSV report has been renamed to Type, and a new Severity column added for this +- Fixed issue with Squiz FunctionCommentSniff reporting incorrect type hint when default value uses namespace + - Thanks to Anti Veeranna for the patch +- Generic FileLengthSniff now uses iconv_strlen to check line length if an encoding is specified (request #14237) +- Generic UnnecessaryStringConcatSniff now allows strings to be combined to form a PHP open or close tag +- Squiz SwitchDeclarationSniff no longer reports indentation errors for BREAK statements inside IF conditions +- Interactive mode now always prints the full error report (ignores command line) +- Improved regular expression detection in JavaScript files + - Added new T_TYPEOF token that can be used to target the typeof JS operator + - Fixes bug #17611 : Regular expression tokens not recognised +- Squiz ScopeIndentSniff removed + - Squiz standard no longer requires additional indents between ob_* methods + - Also removed Squiz OutputBufferingIndentSniff that was checking the same thing +- PHP_CodeSniffer_File::getMemberProperties() performance improved significantly + - Improves performance of Squiz ValidVariableNameSniff significantly +- Squiz OperatorSpacingSniff performance improved significantly +- Squiz NonExecutableCodeSniff performance improved significantly + - Will throw duplicate errors in some cases now, but these should be rare +- MySource IncludeSystemSniff performance improved significantly +- MySource JoinStringsSniff no longer reports an error when using join() on a named JS array +- Warnings are now reported for each file when they cannot be opened instead of stopping the script + - Hide warnings with the -n command line argument + - Can override the warnings using the code Internal.DetectLineEndings + +### Fixed +- Fixed bug #17693 : issue with pre-commit hook script with filenames that start with v +- Fixed bug #17860 : isReference function fails with references in array + - Thanks to Lincoln Maskey for the patch +- Fixed bug #17902 : Cannot run tests when tests are symlinked into tests dir + - Thanks to Matt Button for the patch +- Fixed bug #17928 : Improve error message for Generic_Sniffs_PHP_UpperCaseConstantSniff + - Thanks to Stefano Kowalke for the patch +- Fixed bug #18039 : JS Tokenizer crash when ] is last character in file +- Fixed bug #18047 : Incorrect handling of namespace aliases as constants + - Thanks to Dmitri Medvedev for the patch +- Fixed bug #18072 : Impossible to exclude path from processing when symlinked +- Fixed bug #18073 : Squiz.PHP.NonExecutableCode fault +- Fixed bug #18117 : PEAR coding standard: Method constructor not sniffed as a function +- Fixed bug #18135 : Generic FunctionCallArgumentSpacingSniff reports function declaration errors +- Fixed bug #18140 : Generic scope indent in exact mode: strange expected/found values for switch +- Fixed bug #18145 : Sniffs are not loaded for custom ruleset file + - Thanks to Scott McCammon for the patch +- Fixed bug #18152 : While and do-while with AbstractPatternSniff +- Fixed bug #18191 : Squiz.PHP.LowercasePHPFunctions does not work with new Date() +- Fixed bug #18193 : CodeSniffer doesn't reconize CR (\r) line endings + +## 1.3.0RC1 - 2010-09-03 +### Changed +- Added exclude pattern support to ruleset.xml file so you can specify ignore patterns in a standard (request #17683) + - Use new exclude-pattern tags to include the ignore rules into your ruleset.xml file + - See CodeSniffer/Standards/PHPCS/ruleset.xml for an example +- Added new --encoding command line argument to specify the encoding of the files being checked + - When set to utf-8, stops the XML-based reports from double-encoding + - When set to something else, helps the XML-based reports encode to utf-8 + - Default value is iso-8859-1 but can be changed with --config-set encoding [value] +- The report is no longer printed to screen when using the --report-file command line option (request #17467) + - If you want to print it to screen as well, use the -v command line argument +- The SVN and GIT blame reports now also show percentage of reported errors per author (request #17606) + - Thanks to Ben Selby for the patch +- Updated the SVN pre-commit hook to work with the new severity levels feature +- Generic SubversionPropertiesSniff now allows properties to have NULL values (request #17682) + - A null value indicates that the property should exist but the value should not be checked +- Generic UpperCaseConstantName Sniff now longer complains about the PHPUnit_MAIN_METHOD constant (request #17798) +- Squiz FileComment sniff now checks JS files as well as PHP files +- Squiz FunctionCommentSniff now supports namespaces in type hints + +### Fixed +- Fixed a problem in Squiz OutputBufferingIndentSniff where block comments were reported as not indented +- Fixed bug #17092 : Problems with utf8_encode and htmlspecialchars with non-ascii chars + - Use the new --encoding=utf-8 command line argument if your files are utf-8 encoded +- Fixed bug #17629 : PHP_CodeSniffer_Tokens::$booleanOperators missing T_LOGICAL_XOR + - Thanks to Matthew Turland for the patch +- Fixed bug #17699 : Fatal error generating code coverage with PHPUnit 5.3.0RC1 +- Fixed bug #17718 : Namespace 'use' statement: used global class name is recognized as constant +- Fixed bug #17734 : Generic SubversionPropertiesSniff complains on non SVN files +- Fixed bug #17742 : EmbeddedPhpSniff reacts negatively to file without closing php tag +- Fixed bug #17823 : Notice: Please no longer include PHPUnit/Framework.php + +## 1.3.0a1 - 2010-07-15 +### Changed +- All CodingStandard.php files have been replaced by ruleset.xml files + - Custom standards will need to be converted over to this new format to continue working +- You can specify a path to your own custom ruleset.xml file by using the --standard command line arg + - e.g., phpcs --standard=/path/to/my/ruleset.xml +- Added a new report type --report=gitblame to show how many errors and warnings were committed by each author + - Has the same functionality as the svnblame report + - Thanks to Ben Selby for the patch +- A new token type T_DOLLAR has been added to allow you to sniff for variable variables (feature request #17095) + - Thanks to Ian Young for the patch +- JS tokenizer now supports T_POWER (^) and T_MOD_EQUAL (%=) tokens (feature request #17441) +- If you have PHP_Timer installed, you'll now get a time/memory summary at the end of a script run + - Only happens when printing reports that are designed to be read on the command line +- Added Generic DeprecatedFunctionsSniff to warn about the use of deprecated functions (feature request #16694) + - Thanks to Sebastian Bergmann for the patch +- Added Squiz LogicalOperatorSniff to ensure that logical operators are surrounded by single spaces +- Added MySource ChannelExceptionSniff to ensure action files only throw ChannelException +- Added new method getClassProperties() for sniffs to use to determine if a class is abstract and/or final + - Thanks to Christian Kaps for the patch +- Generic UpperCaseConstantSniff no longer throws errors about namespaces + - Thanks to Christian Kaps for the patch +- Squiz OperatorBracketSniff now correctly checks value assignments in arrays +- Squiz LongConditionClosingCommentSniff now requires a comment for long CASE statements that use curly braces +- Squiz LongConditionClosingCommentSniff now requires an exact comment match on the brace +- MySource IncludeSystemSniff now ignores DOMDocument usage +- MySource IncludeSystemSniff no longer requires inclusion of systems that are being implemented +- Removed found and expected messages from Squiz ConcatenationSpacingSniff because they were messy and not helpful + +### Fixed +- Fixed a problem where Generic CodeAnalysisSniff could show warnings if checking multi-line strings +- Fixed error messages in Squiz ArrayDeclarationSniff reporting incorrect number of found and expected spaces +- Fixed bug #17048 : False positive in Squiz_WhiteSpace_ScopeKeywordSpacingSniff +- Fixed bug #17054 : phpcs more strict than PEAR CS regarding function parameter spacing +- Fixed bug #17096 : Notice: Undefined index: scope_condition in ScopeClosingBraceSniff.php + - Moved PEAR.Functions.FunctionCallArgumentSpacing to Generic.Functions.FunctionCallArgumentSpacing +- Fixed bug #17144 : Deprecated: Function eregi() is deprecated +- Fixed bug #17236 : PHP Warning due to token_get_all() in DoubleQuoteUsageSniff +- Fixed bug #17243 : Alternate Switch Syntax causes endless loop of Notices in SwitchDeclaration +- Fixed bug #17313 : Bug with switch case structure +- Fixed bug #17331 : Possible parse error: interfaces may not include member vars +- Fixed bug #17337 : CSS tokenizer fails on quotes urls +- Fixed bug #17420 : Uncaught exception when comment before function brace +- Fixed bug #17503 : closures formatting is not supported + +## 1.2.2 - 2010-01-27 +### Changed +- The core PHP_CodeSniffer_File methods now understand the concept of closures (feature request #16866) + - Thanks to Christian Kaps for the sample code +- Sniffs can now specify violation codes for each error and warning they add + - Future versions will allow you to override messages and severities using these codes + - Specifying a code is optional, but will be required if you wish to support overriding +- All reports have been broken into separate classes + - Command line usage and report output remains the same + - Thanks to Gabriele Santini for the patch +- Added an interactive mode that can be enabled using the -a command line argument + - Scans files and stops when it finds a file with errors + - Waits for user input to recheck the file (hopefully you fixed the errors) or skip the file + - Useful for very large code bases where full rechecks take a while +- The reports now show the correct number of errors and warnings found +- The isCamelCaps method now allows numbers in class names +- The JS tokenizer now correctly identifies boolean and bitwise AND and OR tokens +- The JS tokenizer now correctly identifies regular expressions used in conditions +- PEAR ValidFunctionNameSniff now ignores closures +- Squiz standard now uses the PEAR setting of 85 chars for LineLengthSniff +- Squiz ControlStructureSpacingSniff now ensure there are no spaces around parentheses +- Squiz LongConditionClosingCommentSniff now checks for comments at the end of try/catch statements +- Squiz LongConditionClosingCommentSniff now checks validity of comments for short structures if they exist +- Squiz IncrementDecrementUsageSniff now has better checking to ensure it only looks at simple variable assignments +- Squiz PostStatementCommentSniff no longer throws errors for end function comments +- Squiz InlineCommentSniff no longer throws errors for end function comments +- Squiz OperatorBracketSniff now allows simple arithmetic operations in SWITCH conditions +- Squiz ValidFunctionNameSniff now ignores closures +- Squiz MethodScopeSniff now ignores closures +- Squiz ClosingDeclarationCommentSniff now ignores closures +- Squiz GlobalFunctionSniff now ignores closures +- Squiz DisallowComparisonAssignmentSniff now ignores the assigning of arrays +- Squiz DisallowObjectStringIndexSniff now allows indexes that contain dots and reserved words +- Squiz standard now throws nesting level and cyclomatic complexity errors at much higher levels +- Squiz CommentedOutCodeSniff now ignores common comment framing characters +- Squiz ClassCommentSniff now ensures the open comment tag is the only content on the first line +- Squiz FileCommentSniff now ensures the open comment tag is the only content on the first line +- Squiz FunctionCommentSniff now ensures the open comment tag is the only content on the first line +- Squiz VariableCommentSniff now ensures the open comment tag is the only content on the first line +- Squiz NonExecutableCodeSniff now warns about empty return statements that are not required +- Removed ForbiddenStylesSniff from Squiz standard + - It is now in in the MySource standard as BrowserSpecificStylesSniff + - New BrowserSpecificStylesSniff ignores files with browser-specific suffixes +- MySource IncludeSystemSniff no longer throws errors when extending the Exception class +- MySource IncludeSystemSniff no longer throws errors for the abstract widget class +- MySource IncludeSystemSniff and UnusedSystemSniff now allow includes inside IF statements +- MySource IncludeSystemSniff no longer throws errors for included widgets inside methods +- MySource GetRequestDataSniff now throws errors for using $_FILES +- MySource CreateWidgetTypeCallbackSniff now allows return statements in nested functions +- MySource DisallowSelfActionsSniff now ignores abstract classes + +### Fixed +- Fixed a problem with the SVN pre-commit hook for PHP versions without vertical whitespace regex support +- Fixed bug #16740 : False positives for heredoc strings and unused parameter sniff +- Fixed bug #16794 : ValidLogicalOperatorsSniff doesn't report operators not in lowercase +- Fixed bug #16804 : Report filename is shortened too much +- Fixed bug #16821 : Bug in Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #16836 : Notice raised when using semicolon to open case +- Fixed bug #16855 : Generic standard sniffs incorrectly for define() method +- Fixed bug #16865 : Two bugs in Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #16902 : Inline If Declaration bug +- Fixed bug #16960 : False positive for late static binding in Squiz/ScopeKeywordSpacingSniff + - Thanks to Jakub Tománek for the patch +- Fixed bug #16976 : The phpcs attempts to process symbolic links that don't resolve to files +- Fixed bug #17017 : Including one file in the files sniffed alters errors reported for another file + +## 1.2.1 - 2009-11-17 +### Changed +- Added a new report type --report=svnblame to show how many errors and warnings were committed by each author + - Also shows the percentage of their code that are errors and warnings + - Requires you to have the SVN command in your path + - Make sure SVN is storing usernames and passwords (if required) or you will need to enter them for each file + - You can also use the -s command line argument to see the different types of errors authors are committing + - You can use the -v command line argument to see all authors, even if they have no errors or warnings +- Added a new command line argument --report-width to allow you to set the column width of screen reports + - Reports wont accept values less than 70 or else they get too small + - Can also be set via a config var: phpcs --config-set report_width 100 +- You can now get PHP_CodeSniffer to ignore a whole file by adding @codingStandardsIgnoreFile in the content + - If you put it in the first two lines the file wont even be tokenized, so it will be much quicker +- Reports now print their file lists in alphabetical order +- PEAR FunctionDeclarationSniff now reports error for incorrect closing bracket placement in multi-line definitions +- Added Generic CallTimePassByReferenceSniff to prohibit the passing of variables into functions by reference + - Thanks to Florian Grandel for the contribution +- Added Squiz DisallowComparisonAssignmentSniff to ban the assignment of comparison values to a variable +- Added Squiz DuplicateStyleDefinitionSniff to check for duplicate CSS styles in a single class block +- Squiz ArrayDeclarationSniff no longer checks the case of array indexes because that is not its job +- Squiz PostStatementCommentSniff now allows end comments for class member functions +- Squiz InlineCommentSniff now supports the checking of JS files +- MySource CreateWidgetTypeCallbackSniff now allows the callback to be passed to another function +- MySource CreateWidgetTypeCallbackSniff now correctly ignores callbacks used inside conditions +- Generic MultipleStatementAlignmentSniff now enforces a single space before equals sign if max padding is reached +- Fixed a problem in the JS tokenizer where regular expressions containing \// were not converted correctly +- Fixed a problem tokenizing CSS files where multiple ID targets on a line would look like comments +- Fixed a problem tokenizing CSS files where class names containing a colon looked like style definitions +- Fixed a problem tokenizing CSS files when style statements had empty url() calls +- Fixed a problem tokenizing CSS colours with the letter E in first half of the code +- Squiz ColonSpacingSniff now ensures it is only checking style definitions in CSS files and not class names +- Squiz DisallowComparisonAssignmentSniff no longer reports errors when assigning the return value of a function +- CSS tokenizer now correctly supports multi-line comments +- When only the case of var names differ for function comments, the error now indicates the case is different + +### Fixed +- Fixed an issue with Generic UnnecessaryStringConcatSniff where it incorrectly suggested removing a concat +- Fixed bug #16530 : ScopeIndentSniff reports false positive +- Fixed bug #16533 : Duplicate errors and warnings +- Fixed bug #16563 : Check file extensions problem in phpcs-svn-pre-commit + - Thanks to Kaijung Chen for the patch +- Fixed bug #16592 : Object operator indentation incorrect when first operator is on a new line +- Fixed bug #16641 : Notice output +- Fixed bug #16682 : Squiz_Sniffs_Strings_DoubleQuoteUsageSniff reports string "\0" as invalid +- Fixed bug #16683 : Typing error in PHP_CodeSniffer_CommentParser_AbstractParser +- Fixed bug #16684 : Bug in Squiz_Sniffs_PHP_NonExecutableCodeSniff +- Fixed bug #16692 : Spaces in paths in Squiz_Sniffs_Debug_JavaScriptLintSniff + - Thanks to Jaroslav Hanslík for the patch +- Fixed bug #16696 : Spelling error in MultiLineConditionSniff +- Fixed bug #16697 : MultiLineConditionSniff incorrect result with inline IF +- Fixed bug #16698 : Notice in JavaScript Tokenizer +- Fixed bug #16736 : Multi-files sniffs aren't processed when FILE is a single directory + - Thanks to Alexey Shein for the patch +- Fixed bug #16792 : Bug in Generic_Sniffs_PHP_ForbiddenFunctionsSniff + +## 1.2.0 - 2009-08-17 +### Changed +- Installed standards are now favoured over custom standards when using the cmd line arg with relative paths +- Unit tests now use a lot less memory while running +- Squiz standard now uses Generic EmptyStatementSniff but throws errors instead of warnings +- Squiz standard now uses Generic UnusedFunctionParameterSniff +- Removed unused ValidArrayIndexNameSniff from the Squiz standard + +### Fixed +- Fixed bug #16424 : SubversionPropertiesSniff print PHP Warning +- Fixed bug #16450 : Constant PHP_CODESNIFFER_VERBOSITY already defined (unit tests) +- Fixed bug #16453 : function declaration long line splitted error +- Fixed bug #16482 : phpcs-svn-pre-commit ignores extensions parameter + +## 1.2.0RC3 - 2009-07-07 +### Changed +- You can now use @codingStandardsIgnoreStart and @...End comments to suppress messages (feature request #14002) +- A warning is now included for files without any code when short_open_tag is set to Off (feature request #12952) +- You can now use relative paths to your custom standards with the --standard cmd line arg (feature request #14967) +- You can now override magic methods and functions in PEAR ValidFunctionNameSniff (feature request #15830) +- MySource IncludeSystemSniff now recognises widget action classes +- MySource IncludeSystemSniff now knows about unit test classes and changes rules accordingly + +## 1.2.0RC2 - 2009-05-25 +### Changed +- Test suite can now be run using the full path to AllTests.php (feature request #16179) + +### Fixed +- Fixed bug #15980 : PHP_CodeSniffer change php current directory + - Thanks to Dolly Aswin Harahap for the patch +- Fixed bug #16001 : Notice triggered +- Fixed bug #16054 : phpcs-svn-pre-commit not showing any errors +- Fixed bug #16071 : Fatal error: Uncaught PHP_CodeSniffer_Exception +- Fixed bug #16170 : Undefined Offset -1 in MultiLineConditionSniff.php on line 68 +- Fixed bug #16175 : Bug in Squiz-IncrementDecrementUsageSniff + +## 1.2.0RC1 - 2009-03-09 +### Changed +- Reports that are output to a file now include a trailing newline at the end of the file +- Fixed sniff names not shown in -vvv token processing output +- Added Generic SubversionPropertiesSniff to check that specific svn props are set for files + - Thanks to Jack Bates for the contribution +- The PHP version check can now be overridden in classes that extend PEAR FileCommentSniff + - Thanks to Helgi Þormar Þorbjörnsson for the suggestion +- Added Generic ConstructorNameSniff to check for PHP4 constructor name usage + - Thanks to Leif Wickland for the contribution +- Squiz standard now supports multi-line function and condition sniffs from PEAR standard +- Squiz standard now uses Generic ConstructorNameSniff +- Added MySource GetRequestDataSniff to ensure REQUEST, GET and POST are not accessed directly +- Squiz OperatorBracketSniff now allows square brackets in simple unbracketed operations + +### Fixed +- Fixed the incorrect tokenizing of multi-line block comments in CSS files +- Fixed bug #15383 : Uncaught PHP_CodeSniffer_Exception +- Fixed bug #15408 : An unexpected exception has been caught: Undefined offset: 2 +- Fixed bug #15519 : Uncaught PHP_CodeSniffer_Exception +- Fixed bug #15624 : Pre-commit hook fails with PHP errors +- Fixed bug #15661 : Uncaught PHP_CodeSniffer_Exception +- Fixed bug #15722 : "declare(encoding = 'utf-8');" leads to "Missing file doc comment" +- Fixed bug #15910 : Object operator indention not calculated correctly + +## 1.2.0a1 - 2008-12-18 +### Changed +- PHP_CodeSniffer now has a CSS tokenizer for checking CSS files +- Added support for a new multi-file sniff that sniffs all processed files at once +- Added new output format --report=emacs to output errors using the emacs standard compile output format + - Thanks to Len Trigg for the contribution +- Reports can now be written to a file using the --report-file command line argument (feature request #14953) + - The report is also written to screen when using this argument +- The CheckStyle, CSV and XML reports now include a source for each error and warning (feature request #13242) + - A new report type --report=source can be used to show you the most common errors in your files +- Added new command line argument -s to show error sources in all reports +- Added new command line argument --sniffs to specify a list of sniffs to restrict checking to + - Uses the sniff source codes that are optionally displayed in reports +- Changed the max width of error lines from 80 to 79 chars to stop blank lines in the default windows cmd window +- PHP_CodeSniffer now has a token for an asperand (@ symbol) so sniffs can listen for them + - Thanks to Andy Brockhurst for the patch +- Added Generic DuplicateClassNameSniff that will warn if the same class name is used in multiple files + - Not currently used by any standard; more of a multi-file sniff sample than anything useful +- Added Generic NoSilencedErrorsSniff that warns if PHP errors are being silenced using the @ symbol + - Thanks to Andy Brockhurst for the contribution +- Added Generic UnnecessaryStringConcatSniff that checks for two strings being concatenated +- Added PEAR FunctionDeclarationSniff to enforce the new multi-line function declaration PEAR standard +- Added PEAR MultiLineAssignmentSniff to enforce the correct indentation of multi-line assignments +- Added PEAR MultiLineConditionSniff to enforce the new multi-line condition PEAR standard +- Added PEAR ObjectOperatorIndentSniff to enforce the new chained function call PEAR standard +- Added MySource DisallowSelfActionSniff to ban the use of self::method() calls in Action classes +- Added MySource DebugCodeSniff to ban the use of Debug::method() calls +- Added MySource CreateWidgetTypeCallback sniff to check callback usage in widget type create methods +- Added Squiz DisallowObjectStringIndexSniff that forces object dot notation in JavaScript files + - Thanks to Sertan Danis for the contribution +- Added Squiz DiscouragedFunctionsSniff to warn when using debug functions +- Added Squiz PropertyLabelSniff to check whitespace around colons in JS property and label declarations +- Added Squiz DuplicatePropertySniff to check for duplicate property names in JS classes +- Added Squiz ColonSpacingSniff to check for spacing around colons in CSS style definitions +- Added Squiz SemicolonSpacingSniff to check for spacing around semicolons in CSS style definitions +- Added Squiz IndentationSniff to check for correct indentation of CSS files +- Added Squiz ColourDefinitionSniff to check that CSS colours are defined in uppercase and using shorthand +- Added Squiz EmptyStyleDefinitionSniff to check for CSS style definitions without content +- Added Squiz EmptyClassDefinitionSniff to check for CSS class definitions without content +- Added Squiz ClassDefinitionOpeningBraceSpaceSniff to check for spaces around opening brace of CSS class definitions +- Added Squiz ClassDefinitionClosingBraceSpaceSniff to check for a single blank line after CSS class definitions +- Added Squiz ClassDefinitionNameSpacingSniff to check for a blank lines inside CSS class definition names +- Added Squiz DisallowMultipleStyleDefinitionsSniff to check for multiple style definitions on a single line +- Added Squiz DuplicateClassDefinitionSniff to check for duplicate CSS class blocks that can be merged +- Added Squiz ForbiddenStylesSniff to check for usage of browser specific styles +- Added Squiz OpacitySniff to check for incorrect opacity values in CSS +- Added Squiz LowercaseStyleDefinitionSniff to check for styles that are not defined in lowercase +- Added Squiz MissingColonSniff to check for style definitions where the colon has been forgotten +- Added Squiz MultiLineFunctionDeclarationSniff to check that multi-line declarations contain one param per line +- Added Squiz JSLintSniff to check for JS errors using the jslint.js script through Rhino + - Set jslint path using phpcs --config-set jslint_path /path/to/jslint.js + - Set rhino path using phpcs --config-set rhino_path /path/to/rhino +- Added Generic TodoSniff that warns about comments that contain the word TODO +- Removed MultipleStatementAlignmentSniff from the PEAR standard as alignment is now optional +- Generic ForbiddenFunctionsSniff now has protected member var to specify if it should use errors or warnings +- Generic MultipleStatementAlignmentSniff now has correct error message if assignment is on a new line +- Generic MultipleStatementAlignmentSniff now has protected member var to allow it to ignore multi-line assignments +- Generic LineEndingsSniff now supports checking of JS files +- Generic LineEndingsSniff now supports checking of CSS files +- Generic DisallowTabIndentSniff now supports checking of CSS files +- Squiz DoubleQuoteUsageSniff now bans the use of variables in double quoted strings in favour of concatenation +- Squiz SuperfluousWhitespaceSniff now supports checking of JS files +- Squiz SuperfluousWhitespaceSniff now supports checking of CSS files +- Squiz DisallowInlineIfSniff now supports checking of JS files +- Squiz SemicolonSpacingSniff now supports checking of JS files +- Squiz PostStatementCommentSniff now supports checking of JS files +- Squiz FunctionOpeningBraceSpacingSniff now supports checking of JS files +- Squiz FunctionClosingBraceSpacingSniff now supports checking of JS files + - Empty JS functions must have their opening and closing braces next to each other +- Squiz ControlStructureSpacingSniff now supports checking of JS files +- Squiz LongConditionClosingCommentSniff now supports checking of JS files +- Squiz OperatorSpacingSniff now supports checking of JS files +- Squiz SwitchDeclarationSniff now supports checking of JS files +- Squiz CommentedOutCodeSniff now supports checking of CSS files +- Squiz DisallowSizeFunctionsInLoopsSniff now supports checking of JS files for the use of object.length +- Squiz DisallowSizeFunctionsInLoopsSniff no longer complains about size functions outside of the FOR condition +- Squiz ControlStructureSpacingSniff now bans blank lines at the end of a control structure +- Squiz ForLoopDeclarationSniff no longer throws errors for JS FOR loops without semicolons +- Squiz MultipleStatementAlignmentSniff no longer throws errors if a statement would take more than 8 spaces to align +- Squiz standard now uses Generic TodoSniff +- Squiz standard now uses Generic UnnecessaryStringConcatSniff +- Squiz standard now uses PEAR MultiLineAssignmentSniff +- Squiz standard now uses PEAR MultiLineConditionSniff +- Zend standard now uses OpeningFunctionBraceBsdAllmanSniff (feature request #14647) +- MySource JoinStringsSniff now bans the use of inline array joins and suggests the + operator +- Fixed incorrect errors that can be generated from abstract scope sniffs when moving to a new file +- Core tokenizer now matches orphaned curly braces in the same way as square brackets +- Whitespace tokens at the end of JS files are now added to the token stack +- JavaScript tokenizer now identifies properties and labels as new token types +- JavaScript tokenizer now identifies object definitions as a new token type and matches curly braces for them +- JavaScript tokenizer now identifies DIV_EQUAL and MUL_EQUAL tokens +- Improved regular expression detection in the JavaScript tokenizer +- Improve AbstractPatternSniff support so it can listen for any token type, not just weighted tokens + +### Fixed +- Fixed Squiz DoubleQuoteUsageSniff so it works correctly with short_open_tag=Off +- Fixed bug #14409 : Output of warnings to log file +- Fixed bug #14520 : Notice: Undefined offset: 1 in /usr/share/php/PHP/CodeSniffer/File.php on line +- Fixed bug #14637 : Call to processUnknownArguments() misses second parameter $pos + - Thanks to Peter Buri for the patch +- Fixed bug #14889 : Lack of clarity: licence or license +- Fixed bug #15008 : Nested Parentheses in Control Structure Sniffs +- Fixed bug #15091 : pre-commit hook attempts to sniff folders + - Thanks to Bruce Weirdan for the patch +- Fixed bug #15124 : AbstractParser.php uses deprecated split() function + - Thanks to Sebastian Bergmann for the patch +- Fixed bug #15188 : PHPCS vs HEREDOC strings +- Fixed bug #15231 : Notice: Uninitialized string offset: 0 in FileCommentSniff.php on line 555 +- Fixed bug #15336 : Notice: Undefined offset: 2 in /usr/share/php/PHP/CodeSniffer/File.php on line + +## 1.1.0 - 2008-07-14 +### Changed +- PEAR FileCommentSniff now allows tag orders to be overridden in child classes + - Thanks to Jeff Hodsdon for the patch +- Added Generic DisallowMultipleStatementsSniff to ensure there is only one statement per line +- Squiz standard now uses DisallowMultipleStatementsSniff + +### Fixed +- Fixed error in Zend ValidVariableNameSniff when checking vars in form: $class->{$var} +- Fixed bug #14077 : Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a class member +- Fixed bug #14168 : Global Function -> Static Method and __autoload() +- Fixed bug #14238 : Line length not checked at last line of a file +- Fixed bug #14249 : wrong detection of scope_opener +- Fixed bug #14250 : ArrayDeclarationSniff emit warnings at malformed array +- Fixed bug #14251 : --extensions option doesn't work + +## 1.1.0RC3 - 2008-07-03 +### Changed +- PEAR FileCommentSniff now allows tag orders to be overridden in child classes + - Thanks to Jeff Hodsdon for the patch +- Added Generic DisallowMultipleStatementsSniff to ensure there is only one statement per line +- Squiz standard now uses DisallowMultipleStatementsSniff + +### Fixed +- Fixed error in Zend ValidVariableNameSniff when checking vars in form: $class->{$var} +- Fixed bug #14077 : Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a class member +- Fixed bug #14168 : Global Function -> Static Method and __autoload() +- Fixed bug #14238 : Line length not checked at last line of a file +- Fixed bug #14249 : wrong detection of scope_opener +- Fixed bug #14250 : ArrayDeclarationSniff emit warnings at malformed array +- Fixed bug #14251 : --extensions option doesn't work + +## 1.1.0RC2 - 2008-06-13 +### Changed +- Permission denied errors now stop script execution but still display current errors (feature request #14076) +- Added Squiz ValidArrayIndexNameSniff to ensure array indexes do not use camel case +- Squiz ArrayDeclarationSniff now ensures arrays are not declared with camel case index values +- PEAR ValidVariableNameSniff now alerts about a possible parse error for member vars inside an interface + +### Fixed +- Fixed bug #13921 : js parsing fails for comments on last line of file +- Fixed bug #13922 : crash in case of malformed (but tokenized) php file + - PEAR and Squiz ClassDeclarationSniff now throw warnings for possible parse errors + - Squiz ValidClassNameSniff now throws warning for possible parse errors + - Squiz ClosingDeclarationCommentSniff now throws additional warnings for parse errors + +## 1.1.0RC1 - 2008-05-13 +### Changed +- Added support for multiple tokenizers so PHP_CodeSniffer can check more than just PHP files + - PHP_CodeSniffer now has a JS tokenizer for checking JavaScript files + - Sniffs need to be updated to work with additional tokenizers, or new sniffs written for them +- phpcs now exits with status 2 if the tokenizer extension has been disabled (feature request #13269) +- Added scripts/phpcs-svn-pre-commit that can be used as an SVN pre-commit hook + - Also reworked the way the phpcs script works to make it easier to wrap it with other functionality + - Thanks to Jack Bates for the contribution +- Fixed error in phpcs error message when a supplied file does not exist +- Fixed a cosmetic error in AbstractPatternSniff where the "found" string was missing some content +- Added sniffs that implement part of the PMD rule catalog to the Generic standard + - Thanks to Manuel Pichler for the contribution of all these sniffs. +- Squiz FunctionCommentThrowTagSniff no longer throws errors for function that only throw variables +- Generic ScopeIndentSniff now has private member to enforce exact indent matching +- Replaced Squiz DisallowCountInLoopsSniff with Squiz DisallowSizeFunctionsInLoopsSniff + - Thanks to Jan Miczaika for the sniff +- Squiz BlockCommentSniff now checks inline doc block comments +- Squiz InlineCommentSniff now checks inline doc block comments +- Squiz BlockCommentSniff now checks for no blank line before first comment in a function +- Squiz DocCommentAlignmentSniff now ignores inline doc block comments +- Squiz ControlStructureSpacingSniff now ensures no blank lines at the start of control structures +- Squiz ControlStructureSpacingSniff now ensures no blank lines between control structure closing braces +- Squiz IncrementDecrementUsageSniff now ensures inc/dec ops are bracketed in string concats +- Squiz IncrementDecrementUsageSniff now ensures inc/dec ops are not used in arithmetic operations +- Squiz FunctionCommentSniff no longer throws errors if return value is mixed but function returns void somewhere +- Squiz OperatorBracketSniff no allows function call brackets to count as operator brackets +- Squiz DoubleQuoteUsageSniff now supports \x \f and \v (feature request #13365) +- Squiz ComparisonOperatorUsageSniff now supports JS files +- Squiz ControlSignatureSniff now supports JS files +- Squiz ForLoopDeclarationSniff now supports JS files +- Squiz OperatorBracketSniff now supports JS files +- Squiz InlineControlStructureSniff now supports JS files +- Generic LowerCaseConstantSniff now supports JS files +- Generic DisallowTabIndentSniff now supports JS files +- Generic MultipleStatementAlignmentSniff now supports JS files +- Added Squiz ObjectMemberCommaSniff to ensure the last member of a JS object is not followed by a comma +- Added Squiz ConstantCaseSniff to ensure the PHP constants are uppercase and JS lowercase +- Added Squiz JavaScriptLintSniff to check JS files with JSL + - Set path using phpcs --config-set jsl_path /path/to/jsl +- Added MySource FirebugConsoleSniff to ban the use of "console" for JS variable and function names +- Added MySource JoinStringsSniff to enforce the use of join() to concatenate JS strings +- Added MySource AssignThisSniff to ensure this is only assigned to a var called self +- Added MySource DisallowNewWidgetSniff to ban manual creation of widget objects +- Removed warning shown in Zend CodeAnalyzerSniff when the ZCA path is not set + +### Fixed +- Fixed error in Squiz ValidVariableNameSniff when checking vars in the form $obj->$var +- Fixed error in Squiz DisallowMultipleAssignmentsSniff when checking vars in the form $obj->$var +- Fixed error in Squiz InlineCommentSniff where comments for class constants were seen as inline +- Fixed error in Squiz BlockCommentSniff where comments for class constants were not ignored +- Fixed error in Squiz OperatorBracketSniff where negative numbers were ignored during comparisons +- Fixed error in Squiz FunctionSpacingSniff where functions after member vars reported incorrect spacing +- Fixed bug #13062 : Interface comments aren't handled in PEAR standard + - Thanks to Manuel Pichler for the path +- Fixed bug #13119 : php minimum requirement need to be fix +- Fixed bug #13156 : Bug in Squiz_Sniffs_PHP_NonExecutableCodeSniff +- Fixed bug #13158 : Strange behaviour in AbstractPatternSniff +- Fixed bug #13169 : Undefined variables +- Fixed bug #13178 : Catch exception in File.php +- Fixed bug #13254 : Notices output in checkstyle report causes XML issues +- Fixed bug #13446 : crash with src of phpMyAdmin + - Thanks to Manuel Pichler for the path + +## 1.0.1a1 - 2008-04-21 +### Changed +- Fixed error in PEAR ValidClassNameSniff when checking class names with double underscores +- Moved Squiz InlineControlStructureSniff into Generic standard +- PEAR standard now throws warnings for inline control structures +- Squiz OutputBufferingIndentSniff now ignores the indentation of inline HTML +- MySource IncludeSystemSniff now ignores usage of ZipArchive +- Removed "function" from error messages for Generic function brace sniffs (feature request #13820) +- Generic UpperCaseConstantSniff no longer throws errors for declare(ticks = ...) + - Thanks to Josh Snyder for the patch +- Squiz ClosingDeclarationCommentSniff and AbstractVariableSniff now throw warnings for possible parse errors + +### Fixed +- Fixed bug #13827 : AbstractVariableSniff throws "undefined index" +- Fixed bug #13846 : Bug in Squiz.NonExecutableCodeSniff +- Fixed bug #13849 : infinite loop in PHP_CodeSniffer_File::findNext() + +## 1.0.1 - 2008-02-04 +### Changed +- Squiz ArrayDeclarationSniff now throws error if the array keyword is followed by a space +- Squiz ArrayDeclarationSniff now throws error for empty multi-line arrays +- Squiz ArrayDeclarationSniff now throws error for multi-line arrays with a single value +- Squiz DocCommentAlignmentSniff now checks for a single space before tags inside docblocks +- Squiz ForbiddenFunctionsSniff now disallows is_null() to force use of (=== NULL) instead +- Squiz VariableCommentSniff now continues throwing errors after the first one is found +- Squiz SuperfluousWhitespaceSniff now throws errors for multiple blank lines inside functions +- MySource IncludedSystemSniff now checks extended class names +- MySource UnusedSystemSniff now checks extended and implemented class names +- MySource IncludedSystemSniff now supports includeWidget() +- MySource UnusedSystemSniff now supports includeWidget() +- Added PEAR ValidVariableNameSniff to check that only private member vars are prefixed with an underscore +- Added Squiz DisallowCountInLoopsSniff to check for the use of count() in FOR and WHILE loop conditions +- Added MySource UnusedSystemSniff to check for included classes that are never used + +### Fixed +- Fixed a problem that caused the parentheses map to sometimes contain incorrect values +- Fixed bug #12767 : Cant run phpcs from dir with PEAR subdir +- Fixed bug #12773 : Reserved variables are not detected in strings + - Thanks to Wilfried Loche for the patch +- Fixed bug #12832 : Tab to space conversion does not work +- Fixed bug #12888 : extra space indentation = Notice: Uninitialized string offset... +- Fixed bug #12909 : Default generateDocs function does not work under linux + - Thanks to Paul Smith for the patch +- Fixed bug #12957 : PHP 5.3 magic method __callStatic + - Thanks to Manuel Pichler for the patch + +## 1.0.0 - 2007-12-21 +### Changed +- You can now specify the full path to a coding standard on the command line (feature request #11886) + - This allows you to use standards that are stored outside of PHP_CodeSniffer's own Standard dir + - You can also specify full paths in the CodingStandard.php include and exclude methods + - Classes, dirs and files need to be names as if the standard was part of PHP_CodeSniffer + - Thanks to Dirk Thomas for the doc generator patch and testing +- Modified the scope map to keep checking after 3 lines for some tokens (feature request #12561) + - Those tokens that must have an opener (like T_CLASS) now keep looking until EOF + - Other tokens (like T_FUNCTION) still stop after 3 lines for performance +- You can now escape commas in ignore patterns so they can be matched in file names + - Thanks to Carsten Wiedmann for the patch +- Config data is now cached in a global var so the file system is not hit so often + - You can also set config data temporarily for the script if you are using your own external script + - Pass TRUE as the third argument to PHP_CodeSniffer::setConfigData() +- PEAR ClassDeclarationSniff no longer throws errors for multi-line class declarations +- Squiz ClassDeclarationSniff now ensures there is one blank line after a class closing brace +- Squiz ClassDeclarationSniff now throws errors for a missing end PHP tag after the end class tag +- Squiz IncrementDecrementUsageSniff no longer throws errors when -= and += are being used with vars +- Squiz SwitchDeclarationSniff now throws errors for switch statements that do not contain a case statement + - Thanks to Sertan Danis for the patch +- MySource IncludeSystemSniff no longer throws errors for the Util package + +### Fixed +- Fixed bug #12621 : "space after AS" check is wrong + - Thanks to Satoshi Oikawa for the patch +- Fixed bug #12645 : error message is wrong + - Thanks to Renoiv for the patch +- Fixed bug #12651 : Increment/Decrement Operators Usage at -1 + +## 1.0.0RC3 - 2007-11-30 +### Changed +- Added new command line argument --tab-width that will convert tabs to spaces before testing + - This allows you to use the existing sniffs that check for spaces even when you use tabs + - Can also be set via a config var: phpcs --config-set tab_width 4 + - A value of zero (the default) tells PHP_CodeSniffer not to replace tabs with spaces +- You can now change the default report format from "full" to something else + - Run: phpcs --config-set report_format [format] +- Improved performance by optimising the way the scope map is created during tokenising +- Added new Squiz DisallowInlineIfSniff to disallow the usage of inline IF statements +- Fixed incorrect errors being thrown for nested switches in Squiz SwitchDeclarationSniff +- PEAR FunctionCommentSniff no longer complains about missing comments for @throws tags +- PEAR FunctionCommentSniff now throws error for missing exception class name for @throws tags +- PHP_CodeSniffer_File::isReference() now correctly returns for functions that return references +- Generic LineLengthSniff no longer warns about @version lines with CVS or SVN id tags +- Generic LineLengthSniff no longer warns about @license lines with long URLs +- Squiz FunctionCommentThrowTagSniff no longer complains about throwing variables +- Squiz ComparisonOperatorUsageSniff no longer throws incorrect errors for inline IF statements +- Squiz DisallowMultipleAssignmentsSniff no longer throws errors for assignments in inline IF statements + +### Fixed +- Fixed bug #12455 : CodeSniffer treats content inside heredoc as PHP code +- Fixed bug #12471 : Checkstyle report is broken +- Fixed bug #12476 : PHP4 destructors are reported as error +- Fixed bug #12513 : Checkstyle XML messages need to be utf8_encode()d + - Thanks to Sebastian Bergmann for the patch. +- Fixed bug #12517 : getNewlineAfter() and dos files + +## 1.0.0RC2 - 2007-11-14 +### Changed +- Added a new Checkstyle report format + - Like the current XML format but modified to look like Checkstyle output + - Thanks to Manuel Pichler for helping get the format correct +- You can now hide warnings by default + - Run: phpcs --config-set show_warnings 0 + - If warnings are hidden by default, use the new -w command line argument to override +- Added new command line argument --config-delete to delete a config value and revert to the default +- Improved overall performance by optimising tokenising and next/prev methods (feature request #12421) + - Thanks to Christian Weiske for the patch +- Added FunctionCallSignatureSniff to Squiz standard +- Added @subpackage support to file and class comment sniffs in PEAR standard (feature request #12382) + - Thanks to Carsten Wiedmann for the patch +- An error is now displayed if you use a PHP version less than 5.1.0 (feature request #12380) + - Thanks to Carsten Wiedmann for the patch +- phpcs now exits with status 2 if it receives invalid input (feature request #12380) + - This is distinct from status 1, which indicates errors or warnings were found +- Added new Squiz LanguageConstructSpacingSniff to throw errors for additional whitespace after echo etc. +- Removed Squiz ValidInterfaceNameSniff +- PEAR FunctionCommentSniff no longer complains about unknown tags + +### Fixed +- Fixed incorrect errors about missing function comments in PEAR FunctionCommentSniff +- Fixed incorrect function docblock detection in Squiz FunctionCommentSniff +- Fixed incorrect errors for list() in Squiz DisallowMultipleAssignmentsSniff +- Errors no longer thrown if control structure is followed by a CASE's BREAK in Squiz ControlStructureSpacingSniff +- Fixed bug #12368 : Autoloader cannot be found due to include_path override + - Thanks to Richard Quadling for the patch +- Fixed bug #12378 : equal sign alignments problem with while() + +## 1.0.0RC1 - 2007-11-01 +### Changed +- Main phpcs script can now be run from a CVS checkout without installing the package +- Added a new CSV report format + - Header row indicates what position each element is in + - Always use the header row to determine positions rather than assuming the format, as it may change +- XML and CSV report formats now contain information about which column the error occurred at + - Useful if you want to highlight the token that caused the error in a custom application +- Square bracket tokens now have bracket_opener and bracket_closer set +- Added new Squiz SemicolonSpacingSniff to throw errors if whitespace is found before a semicolon +- Added new Squiz ArrayBracketSpacingSniff to throw errors if whitespace is found around square brackets +- Added new Squiz ObjectOperatorSpacingSniff to throw errors if whitespace is found around object operators +- Added new Squiz DisallowMultipleAssignmentsSniff to throw errors if multiple assignments are on the same line +- Added new Squiz ScopeKeywordSpacingSniff to throw errors if there is not a single space after a scope modifier +- Added new Squiz ObjectInstantiationSniff to throw errors if new objects are not assigned to a variable +- Added new Squiz FunctionDuplicateArgumentSniff to throw errors if argument is declared multiple times in a function +- Added new Squiz FunctionOpeningBraceSpaceSniff to ensure there are no blank lines after a function open brace +- Added new Squiz CommentedOutCodeSniff to warn about comments that looks like they are commented out code blocks +- Added CyclomaticComplexitySniff to Squiz standard +- Added NestingLevelSniff to Squiz standard +- Squiz ForbiddenFunctionsSniff now recommends echo() instead of print() +- Squiz ValidLogicalOperatorsSniff now recommends ^ instead of xor +- Squiz SwitchDeclarationSniff now contains more checks + - A single space is required after the case keyword + - No space is allowed before the colon in a case or default statement + - All switch statements now require a default case + - Default case must contain a break statement + - Empty default case must contain a comment describing why the default is ignored + - Empty case statements are not allowed + - Case and default statements must not be followed by a blank line + - Break statements must be followed by a blank line or the closing brace + - There must be no blank line before a break statement +- Squiz standard is now using the PEAR IncludingFileSniff +- PEAR ClassCommentSniff no longer complains about unknown tags +- PEAR FileCommentSniff no longer complains about unknown tags +- PEAR FileCommentSniff now accepts multiple @copyright tags +- Squiz BlockCommentSniff now checks that comment starts with a capital letter +- Squiz InlineCommentSniff now has better checking to ensure comment starts with a capital letter +- Squiz ClassCommentSniff now checks that short and long comments start with a capital letter +- Squiz FunctionCommentSniff now checks that short, long and param comments start with a capital letter +- Squiz VariableCommentSniff now checks that short and long comments start with a capital letter + +### Fixed +- Fixed error with multi-token array indexes in Squiz ArrayDeclarationSniff +- Fixed error with checking shorthand IF statements without a semicolon in Squiz InlineIfDeclarationSniff +- Fixed error where constants used as default values in function declarations were seen as type hints +- Fixed bug #12316 : PEAR is no longer the default standard +- Fixed bug #12321 : wrong detection of missing function docblock + +## 0.9.0 - 2007-09-24 +### Changed +- Added a config system for setting config data across phpcs runs +- You can now change the default coding standard from PEAR to something else + - Run: phpcs --config-set default_standard [standard] +- Added new Zend coding standard to check code against the Zend Framework standards + - The complete standard is not yet implemented + - Specify --standard=Zend to use + - Thanks to Johann-Peter Hartmann for the contribution of some sniffs + - Thanks to Holger Kral for the Code Analyzer sniff + +## 0.8.0 - 2007-08-08 +### Changed +- Added new XML report format; --report=xml (feature request #11535) + - Thanks to Brett Bieber for the patch +- Added new command line argument --ignore to specify a list of files to skip (feature request #11556) +- Added PHPCS and MySource coding standards into the core install +- Scope map no longer gets confused by curly braces that act as string offsets +- Removed CodeSniffer/SniffException.php as it is no longer used +- Unit tests can now be run directly from a CVS checkout +- Made private vars and functions protected in PHP_CodeSniffer class so this package can be overridden +- Added new Metrics category to Generic coding standard + - Contains Cyclomatic Complexity and Nesting Level sniffs + - Thanks to Johann-Peter Hartmann for the contribution +- Added new Generic DisallowTabIndentSniff to throw errors if tabs are used for indentation (feature request #11738) + - PEAR and Squiz standards use this new sniff to throw more specific indentation errors +- Generic MultipleStatementAlignmentSniff has new private var to set a padding size limit (feature request #11555) +- Generic MultipleStatementAlignmentSniff can now handle assignments that span multiple lines (feature request #11561) +- Generic LineLengthSniff now has a max line length after which errors are thrown instead of warnings + - BC BREAK: Override the protected member var absoluteLineLimit and set it to zero in custom LineLength sniffs + - Thanks to Johann-Peter Hartmann for the contribution +- Comment sniff errors about incorrect tag orders are now more descriptive (feature request #11693) + +### Fixed +- Fixed bug #11473 : Invalid CamelCaps name when numbers used in names + +## 0.7.0 - 2007-07-02 +### Changed +- BC BREAK: EOL character is now auto-detected and used instead of hard-coded \n + - Pattern sniffs must now specify "EOL" instead of "\n" or "\r\n" to use auto-detection + - Please use $phpcsFile->eolChar to check for newlines instead of hard-coding "\n" or "\r\n" + - Comment parser classes now require you to pass $phpcsFile as an additional argument +- BC BREAK: Included and excluded sniffs now require .php extension + - Please update your coding standard classes and add ".php" to all sniff entries + - See CodeSniffer/Standards/PEAR/PEARCodingStandard.php for an example + +- Fixed error where including a directory of sniffs in a coding standard class did not work +- Coding standard classes can now specify a list of sniffs to exclude as well as include (feature request #11056) +- Two uppercase characters can now be placed side-by-side in class names in Squiz ValidClassNameSniff +- SVN tags now allowed in PEAR file doc blocks (feature request #11038) + - Thanks to Torsten Roehr for the patch +- Private methods in commenting sniffs and comment parser are now protected (feature request #11087) +- Added Generic LineEndingsSniff to check the EOL character of a file +- PEAR standard now only throws one error per file for incorrect line endings (eg. /r/n) +- Command line arg -v now shows number of registered sniffs +- Command line arg -vvv now shows list of registered sniffs +- Squiz ControlStructureSpacingSniff no longer throws errors if the control structure is at the end of the script +- Squiz FunctionCommentSniff now throws error for "return void" if function has return statement +- Squiz FunctionCommentSniff now throws error for functions that return void but specify something else +- Squiz ValidVariableNameSniff now allows multiple uppercase letters in a row +- Squiz ForEachLoopDeclarationSniff now throws error for AS keyword not being lowercase +- Squiz SwitchDeclarationSniff now throws errors for CASE/DEFAULT/BREAK keywords not being lowercase +- Squiz ArrayDeclarationSniff now handles multi-token array values when checking alignment +- Squiz standard now enforces a space after cast tokens +- Generic MultipleStatementAlignmentSniff no longer gets confused by assignments inside FOR conditions +- Generic MultipleStatementAlignmentSniff no longer gets confused by the use of list() +- Added Generic SpaceAfterCastSniff to ensure there is a single space after a cast token +- Added Generic NoSpaceAfterCastSniff to ensure there is no whitespace after a cast token +- Added PEAR ClassDeclarationSniff to ensure the opening brace of a class is on the line after the keyword +- Added Squiz ScopeClosingBraceSniff to ensure closing braces are aligned correctly +- Added Squiz EvalSniff to discourage the use of eval() +- Added Squiz LowercaseDeclarationSniff to ensure all declaration keywords are lowercase +- Added Squiz LowercaseClassKeywordsSniff to ensure all class declaration keywords are lowercase +- Added Squiz LowercaseFunctionKeywordsSniff to ensure all function declaration keywords are lowercase +- Added Squiz LowercasePHPFunctionsSniff to ensure all calls to inbuilt PHP functions are lowercase +- Added Squiz CastSpacingSniff to ensure cast statements dont contain whitespace +- Errors no longer thrown when checking 0 length files with verbosity on + +### Fixed +- Fixed bug #11105 : getIncludedSniffs() not working anymore + - Thanks to Blair Robertson for the patch +- Fixed bug #11120 : Uninitialized string offset in AbstractParser.php on line 200 + +## 0.6.0 - 2007-05-15 +### Changed +- The number of errors and warnings found is now shown for each file while checking the file if verbosity is enabled +- Now using PHP_EOL instead of hard-coded \n so output looks good on Windows (feature request #10761) + - Thanks to Carsten Wiedmann for the patch. +- phpcs now exits with status 0 (no errors) or 1 (errors found) (feature request #10348) +- Added new -l command line argument to stop recursion into directories (feature request #10979) + +### Fixed +- Fixed variable name error causing incorrect error message in Squiz ValidVariableNameSniff +- Fixed bug #10757 : Error in ControlSignatureSniff +- Fixed bugs #10751, #10777 : Sniffer class paths handled incorrectly in Windows + - Thanks to Carsten Wiedmann for the patch. +- Fixed bug #10961 : Error "Last parameter comment requires a blank newline after it" thrown +- Fixed bug #10983 : phpcs outputs notices when checking invalid PHP +- Fixed bug #10980 : Incorrect warnings for equals sign + +## 0.5.0 - 2007-04-17 +### Changed +- BC BREAK: Coding standards now require a class to be added so PHP_CodeSniffer can get information from them + - Please read the end user docs for info about the new class required for all coding standards + +- Coding standards can now include sniffs from other standards, or whole standards, without writing new sniff files +- PHP_CodeSniffer_File::isReference() now correctly returns for references in function declarations +- PHP_CodeSniffer_File::isReference() now returns false if you don't pass it a T_BITWISE_AND token +- PHP_CodeSniffer_File now stores the absolute path to the file so sniffs can check file locations correctly +- Fixed undefined index error in AbstractVariableSniff for variables inside an interface function definition +- Added MemberVarSpacingSniff to Squiz standard to enforce one-line spacing between member vars +- Add FunctionCommentThrowTagSniff to Squiz standard to check that @throws tags are correct + +### Fixed +- Fixed problems caused by references and type hints in Squiz FunctionDeclarationArgumentSpacingSniff +- Fixed problems with errors not being thrown for some misaligned @param comments in Squiz FunctionCommentSniff +- Fixed badly spaced comma error being thrown for "extends" class in Squiz ClassDeclarationSniff +- Errors no longer thrown for class method names in Generic ForbiddenFunctionsSniff +- Errors no longer thrown for type hints in front of references in Generic UpperCaseConstantNameSniff +- Errors no longer thrown for correctly indented buffered lines in Squiz ScopeIndexSniff +- Errors no longer thrown for user-defined functions named as forbidden functions in Generic ForbiddenFunctionsSniff +- Errors no longer thrown on __autoload functions in PEAR ValidFunctionNameSniff +- Errors now thrown for __autoload methods in PEAR ValidFunctionNameSniff +- Errors now thrown if constructors or destructors have @return tags in Squiz FunctionCommentSniff +- Errors now thrown if @throws tags dont start with a capital and end with a full stop in Squiz FunctionCommentSniff +- Errors now thrown for invalid @var tag values in Squiz VariableCommentSniff +- Errors now thrown for missing doc comment in Squiz VariableCommentSniff +- Errors now thrown for unspaced operators in FOR loop declarations in Squiz OperatorSpacingSniff +- Errors now thrown for using ob_get_clean/flush functions to end buffers in Squiz OutputBufferingIndentSniff +- Errors now thrown for all missing member variable comments in Squiz VariableCommentSniff + +## 0.4.0 - 2007-02-19 +### Changed +- Standard name specified with --standard command line argument is no longer case sensitive +- Long error and warning messages are now wrapped to 80 characters in the full error report (thanks Endre Czirbesz) +- Shortened a lot of error and warning messages so they don't take up so much room +- Squiz FunctionCommentSniff now checks that param comments start with a capital letter and end with a full stop +- Squiz FunctionSpacingSniff now reports incorrect lines below function on closing brace, not function keyword +- Squiz FileCommentSniff now checks that there are no blank lines between the open PHP tag and the comment +- PHP_CodeSniffer_File::isReference() now returns correctly when checking refs on right side of => + +### Fixed +- Fixed incorrect error with switch closing brace in Squiz SwitchDeclarationSniff +- Fixed missing error when multiple statements are not aligned correctly with object operators +- Fixed incorrect errors for some PHP special variables in Squiz ValidVariableNameSniff +- Fixed incorrect errors for arrays that only contain other arrays in Squiz ArrayDeclarationSniff +- Fixed bug #9844 : throw new Exception(\n accidentally reported as error but it ain't + +## 0.3.0 - 2007-01-11 +### Changed +- Updated package.xml to version 2 +- Specifying coding standard on command line is now optional, even if you have multiple standards installed + - PHP_CodeSniffer uses the PEAR coding standard by default if no standard is specified +- New command line option, --extensions, to specify a comma separated list of file extensions to check +- Converted all unit tests to PHPUnit 3 format +- Added new coding standard, Squiz, that can be used as an alternative to PEAR + - also contains more examples of sniffs + - some may be moved into the Generic coding standard if required +- Added MultipleStatementAlignmentSniff to Generic standard +- Added ScopeIndentSniff to Generic standard +- Added ForbiddenFunctionsSniff to Generic standard +- Added FileCommentSniff to PEAR standard +- Added ClassCommentSniff to PEAR standard +- Added FunctionCommentSniff to PEAR standard +- Change MultipleStatementSniff to MultipleStatementAlignmentSniff in PEAR standard +- Replaced Methods directory with Functions directory in Generic and PEAR standards + - also renamed some of the sniffs in those directories +- Updated file, class and method comments for all files + +### Fixed +- Fixed bug #9274 : nested_parenthesis element not set for open and close parenthesis tokens +- Fixed bug #9411 : too few pattern characters cause incorrect error report + +## 0.2.1 - 2006-11-09 +### Fixed +- Fixed bug #9274 : nested_parenthesis element not set for open and close parenthesis tokens + +## 0.2.0 - 2006-10-13 +### Changed +- Added a generic standards package that will contain generic sniffs to be used in specific coding standards + - thanks to Frederic Poeydomenge for the idea +- Changed PEAR standard to use generic sniffs where available +- Added LowerCaseConstantSniff to Generic standard +- Added UpperCaseConstantSniff to Generic standard +- Added DisallowShortOpenTagSniff to Generic standard +- Added LineLengthSniff to Generic standard +- Added UpperCaseConstantNameSniff to Generic standard +- Added OpeningMethodBraceBsdAllmanSniff to Generic standard (contrib by Frederic Poeydomenge) +- Added OpeningMethodBraceKernighanRitchieSniff to Generic standard (contrib by Frederic Poeydomenge) +- Added framework for core PHP_CodeSniffer unit tests +- Added unit test for PHP_CodeSniffer:isCamelCaps method +- ScopeClosingBraceSniff now checks indentation of BREAK statements +- Added new command line arg (-vv) to show developer debug output + +### Fixed +- Fixed some coding standard errors +- Fixed bug #8834 : Massive memory consumption +- Fixed bug #8836 : path case issues in package.xml +- Fixed bug #8843 : confusion on nested switch() +- Fixed bug #8841 : comments taken as whitespace +- Fixed bug #8884 : another problem with nested switch() statements + +## 0.1.1 - 2006-09-25 +### Changed +- Added unit tests for all PEAR sniffs +- Exception class now extends from PEAR_Exception + +### Fixed +- Fixed summary report so files without errors but with warnings are not shown when warnings are hidden + +## 0.1.0 - 2006-09-19 +### Changed +- Reorganised package contents to conform to PEAR standards +- Changed version numbering to conform to PEAR standards +- Removed duplicate require_once() of Exception.php from CodeSniffer.php + +## 0.0.5 - 2006-09-18 +### Fixed +- Fixed .bat file for situation where php.ini cannot be found so include_path is not set + +## 0.0.4 - 2006-08-28 +### Changed +- Added .bat file for easier running of PHP_CodeSniffer on Windows +- Sniff that checks method names now works for PHP4 style code where there is no scope keyword +- Sniff that checks method names now works for PHP4 style constructors +- Sniff that checks method names no longer incorrectly reports error with magic methods +- Sniff that checks method names now reports errors with non-magic methods prefixed with __ +- Sniff that checks for constant names no longer incorrectly reports errors with heredoc strings +- Sniff that checks for constant names no longer incorrectly reports errors with created objects +- Sniff that checks indentation no longer incorrectly reports errors with heredoc strings +- Sniff that checks indentation now correctly reports errors with improperly indented multi-line strings +- Sniff that checks function declarations now checks for spaces before and after an equals sign for default values +- Sniff that checks function declarations no longer incorrectly reports errors with multi-line declarations +- Sniff that checks included code no longer incorrectly reports errors when return value is used conditionally +- Sniff that checks opening brace of function no longer incorrectly reports errors with multi-line declarations +- Sniff that checks spacing after commas in function calls no longer reports too many errors for some code +- Sniff that checks control structure declarations now gives more descriptive error message + +## 0.0.3 - 2006-08-22 +### Changed +- Added sniff to check for invalid class and interface names +- Added sniff to check for invalid function and method names +- Added sniff to warn if line is greater than 85 characters +- Added sniff to check that function calls are in the correct format +- Added command line arg to print current version (--version) + +### Fixed +- Fixed error where comments were not allowed on the same line as a control structure declaration + +## 0.0.2 - 2006-07-25 +### Changed +- Removed the including of checked files to stop errors caused by parsing them +- Removed the use of reflection so checked files do not have to be included +- Memory usage has been greatly reduced +- Much faster tokenising and checking times +- Reworked the PEAR coding standard sniffs (much faster now) +- Fix some bugs with the PEAR scope indentation standard +- Better checking for installed coding standards +- Can now accept multiple files and dirs on the command line +- Added an option to list installed coding standards +- Added an option to print a summary report (number of errors and warnings shown for each file) +- Added an option to hide warnings from reports +- Added an option to print verbose output (so you know what is going on) +- Reordered command line args to put switches first (although order is not enforced) +- Switches can now be specified together (eg. php -nv) as well as separately (phpcs -n -v) + +## 0.0.1 - 2006-07-19 +### Added +- Initial preview release + +[Unreleased]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/master...HEAD +[3.8.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.7.2...3.8.0 +[3.7.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.7.1...3.7.2 +[3.7.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.7.0...3.7.1 +[3.7.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.6.2...3.7.0 +[3.6.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.6.1...3.6.2 +[3.6.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.6.0...3.6.1 +[3.6.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.8...3.6.0 +[3.5.8]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.7...3.5.8 +[3.5.7]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.6...3.5.7 +[3.5.6]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.5...3.5.6 +[3.5.5]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.4...3.5.5 +[3.5.4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.3...3.5.4 +[3.5.3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.2...3.5.3 +[3.5.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.1...3.5.2 +[3.5.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.5.0...3.5.1 +[3.5.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.4.2...3.5.0 +[3.4.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.4.1...3.4.2 +[3.4.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.4.0...3.4.1 +[3.4.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.3.2...3.4.0 +[3.3.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.3.1...3.3.2 +[3.3.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.3.0...3.3.1 +[3.3.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.2.3...3.3.0 +[3.2.3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.2.2...3.2.3 +[3.2.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.1.1...3.2.0 +[3.1.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.1.0...3.1.1 +[3.1.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.2...3.1.0 +[3.0.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.1...3.0.2 +[3.0.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.0...3.0.1 +[3.0.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.0RC4...3.0.0 +[3.0.0RC4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.0RC3...3.0.0RC4 +[3.0.0RC3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.0RC2...3.0.0RC3 +[3.0.0RC2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.0RC1...3.0.0RC2 +[3.0.0RC1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.0.0a1...3.0.0RC1 +[3.0.0a1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.9.2...3.0.0a1 +[2.9.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.9.1...2.9.2 +[2.9.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.9.0...2.9.1 +[2.9.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.8.1...2.9.0 +[2.8.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.8.0...2.8.1 +[2.8.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.7.1...2.8.0 +[2.7.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.7.0...2.7.1 +[2.7.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.6.2...2.7.0 +[2.6.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.6.1...2.6.2 +[2.6.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.6.0...2.6.1 +[2.6.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.5.1...2.6.0 +[2.5.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.5.0...2.5.1 +[2.5.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.4.0...2.5.0 +[2.4.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.3.4...2.4.0 +[2.3.4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.3.3...2.3.4 +[2.3.3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.3.2...2.3.3 +[2.3.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.3.1...2.3.2 +[2.3.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.3.0...2.3.1 +[2.3.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.2.0...2.3.0 +[2.2.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.1.0...2.2.0 +[2.1.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.0.0...2.1.0 +[2.0.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.0.0RC4...2.0.0 +[2.0.0RC4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.0.0RC3...2.0.0RC4 +[2.0.0RC3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.0.0RC2...2.0.0RC3 +[2.0.0RC2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.0.0RC1...2.0.0RC2 +[2.0.0RC1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.0.0a2...2.0.0RC1 +[2.0.0a2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/2.0.0a1...2.0.0a2 +[2.0.0a1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.6...2.0.0a1 +[1.5.6]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.5...1.5.6 +[1.5.5]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.4...1.5.5 +[1.5.4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.3...1.5.4 +[1.5.3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.2...1.5.3 +[1.5.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.0RC4...1.5.0 +[1.5.0RC4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.0RC3...1.5.0RC4 +[1.5.0RC3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.0RC2...1.5.0RC3 +[1.5.0RC2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.5.0RC1...1.5.0RC2 +[1.5.0RC1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.8...1.5.0RC1 +[1.4.8]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.7...1.4.8 +[1.4.7]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.6...1.4.7 +[1.4.6]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.5...1.4.6 +[1.4.5]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.4...1.4.5 +[1.4.4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.3...1.4.4 +[1.4.3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.2...1.4.3 +[1.4.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.3.6...1.4.0 +[1.3.6]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.3.5...1.3.6 +[1.3.5]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.3.4...1.3.5 +[1.3.4]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.3.3...1.3.4 +[1.3.3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.3.2...1.3.3 +[1.3.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/1.3.1...1.3.2 diff --git a/vendor/squizlabs/php_codesniffer/CONTRIBUTING.md b/vendor/squizlabs/php_codesniffer/CONTRIBUTING.md deleted file mode 100644 index 5cc73635..00000000 --- a/vendor/squizlabs/php_codesniffer/CONTRIBUTING.md +++ /dev/null @@ -1,13 +0,0 @@ -Contributing -------------- - -Before you contribute code to PHP\_CodeSniffer, please make sure it conforms to the PHPCS coding standard and that the PHP\_CodeSniffer unit tests still pass. The easiest way to contribute is to work on a checkout of the repository, or your own fork, rather than an installed PEAR version. If you do this, you can run the following commands to check if everything is ready to submit: - - cd PHP_CodeSniffer - php bin/phpcs - -Which should display no coding standard errors. And then: - - phpunit - -Which should give you no failures or errors. You can ignore any skipped tests as these are for external tools. diff --git a/vendor/squizlabs/php_codesniffer/README.md b/vendor/squizlabs/php_codesniffer/README.md index 859de432..e65acb61 100644 --- a/vendor/squizlabs/php_codesniffer/README.md +++ b/vendor/squizlabs/php_codesniffer/README.md @@ -1,30 +1,44 @@ +PHP_CodeSniffer +===================================================== + + + +> [!NOTE] +> This package is the continuation of the now abandoned [PHP_CodeSniffer package which was created by Squizlabs](https://github.com/squizlabs/PHP_CodeSniffer). + ## About PHP_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent. -[![Build Status](https://github.com/squizlabs/PHP_CodeSniffer/workflows/Validate/badge.svg?branch=master)](https://github.com/squizlabs/PHP_CodeSniffer/actions) -[![Build Status](https://github.com/squizlabs/PHP_CodeSniffer/workflows/Test/badge.svg?branch=master)](https://github.com/squizlabs/PHP_CodeSniffer/actions) -[![Code consistency](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer/grade.svg)](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer) -[![Join the chat at https://gitter.im/squizlabs/PHP_CodeSniffer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## Requirements -PHP_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements. +PHP_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements. -If you're using PHP_CodeSniffer as part of a team, or you're running it on a [CI](https://en.wikipedia.org/wiki/Continuous_integration) server, you may want to configure your project's settings [using a configuration file](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file). +If you're using PHP_CodeSniffer as part of a team, or you're running it on a [CI](https://en.wikipedia.org/wiki/Continuous_integration) server, you may want to configure your project's settings [using a configuration file](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file). ## Installation The easiest way to get started with PHP_CodeSniffer is to download the Phar files for each of the commands: -``` +```bash # Download using curl -curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar +curl -OL https://phars.phpcodesniffer.com/phpcs.phar +curl -OL https://phars.phpcodesniffer.com/phpcbf.phar # Or download using wget -wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar +wget https://phars.phpcodesniffer.com/phpcs.phar +wget https://phars.phpcodesniffer.com/phpcbf.phar # Then test the downloaded PHARs php phpcs.phar -h @@ -43,7 +57,7 @@ Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your ` ```json { "require-dev": { - "squizlabs/php_codesniffer": "3.*" + "squizlabs/php_codesniffer": "^3.0" } } ``` @@ -59,20 +73,15 @@ If you use Phive, you can install PHP_CodeSniffer as a project tool using the fo phive install phpcs phive install phpcbf ``` -You will then be able to run PHP_CodeSniffer from the tools directory: +You will then be able to run PHP_CodeSniffer from the `tools` directory: ```bash ./tools/phpcs -h ./tools/phpcbf -h ``` -### PEAR -If you use PEAR, you can install PHP_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf` commands immediately available for use. To install PHP_CodeSniffer using the PEAR installer, first ensure you have [installed PEAR](http://pear.php.net/manual/en/installation.getting.php) and then run the following command: -```bash -pear install PHP_CodeSniffer -``` ### Git Clone You can also download the PHP_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone: ```bash -git clone https://github.com/squizlabs/PHP_CodeSniffer.git +git clone https://github.com/PHPCSStandards/PHP_CodeSniffer.git cd PHP_CodeSniffer php bin/phpcs -h php bin/phpcbf -h @@ -94,19 +103,19 @@ phpcs --standard=PSR12 /path/to/code-directory If PHP_CodeSniffer finds any coding standard errors, a report will be shown after running the command. -Full usage information and example reports are available on the [usage page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). +Full usage information and example reports are available on the [usage page](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage). ## Documentation -The documentation for PHP_CodeSniffer is available on the [Github wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki). +The documentation for PHP_CodeSniffer is available on the [GitHub wiki](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki). ## Issues -Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues). +Bug reports and feature requests can be submitted on the [GitHub Issue Tracker](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues). ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) for information. +See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for information. ## Versioning diff --git a/vendor/squizlabs/php_codesniffer/autoload.php b/vendor/squizlabs/php_codesniffer/autoload.php index 0dcf1b4c..7e546bb5 100644 --- a/vendor/squizlabs/php_codesniffer/autoload.php +++ b/vendor/squizlabs/php_codesniffer/autoload.php @@ -11,7 +11,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer; diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcbf b/vendor/squizlabs/php_codesniffer/bin/phpcbf index 45b43f43..2e86a40e 100755 --- a/vendor/squizlabs/php_codesniffer/bin/phpcbf +++ b/vendor/squizlabs/php_codesniffer/bin/phpcbf @@ -5,7 +5,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ if (is_file(__DIR__.'/../autoload.php') === true) { diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat b/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat index 5b07a7d9..da3b0401 100644 --- a/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat +++ b/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat @@ -3,10 +3,8 @@ REM PHP Code Beautifier and Fixer fixes violations of a defined coding standard. REM REM @author Greg Sherwood REM @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) -REM @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence +REM @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence -if "%PHP_PEAR_PHP_BIN%" neq "" ( - set PHPBIN=%PHP_PEAR_PHP_BIN% -) else set PHPBIN=php +set PHPBIN=php "%PHPBIN%" "%~dp0\phpcbf" %* diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcs b/vendor/squizlabs/php_codesniffer/bin/phpcs index 52d28cdf..e8e8b028 100755 --- a/vendor/squizlabs/php_codesniffer/bin/phpcs +++ b/vendor/squizlabs/php_codesniffer/bin/phpcs @@ -5,7 +5,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ if (is_file(__DIR__.'/../autoload.php') === true) { diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcs.bat b/vendor/squizlabs/php_codesniffer/bin/phpcs.bat index 9f9be720..a95722b4 100755 --- a/vendor/squizlabs/php_codesniffer/bin/phpcs.bat +++ b/vendor/squizlabs/php_codesniffer/bin/phpcs.bat @@ -3,10 +3,8 @@ REM PHP_CodeSniffer detects violations of a defined coding standard. REM REM @author Greg Sherwood REM @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) -REM @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence +REM @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence -if "%PHP_PEAR_PHP_BIN%" neq "" ( - set PHPBIN=%PHP_PEAR_PHP_BIN% -) else set PHPBIN=php +set PHPBIN=php "%PHPBIN%" "%~dp0\phpcs" %* diff --git a/vendor/squizlabs/php_codesniffer/composer.json b/vendor/squizlabs/php_codesniffer/composer.json index 37f41a0b..a477d20a 100644 --- a/vendor/squizlabs/php_codesniffer/composer.json +++ b/vendor/squizlabs/php_codesniffer/composer.json @@ -7,18 +7,27 @@ "standards", "static analysis" ], - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "license": "BSD-3-Clause", "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name" : "Contributors", + "homepage" : "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki", - "source": "https://github.com/squizlabs/PHP_CodeSniffer" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy" }, "extra": { "branch-alias": { @@ -32,10 +41,42 @@ "ext-simplexml": "*" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/phpcs", "bin/phpcbf" - ] + ], + "scripts": { + "cs": [ + "@php ./bin/phpcs" + ], + "cbf": [ + "@php ./bin/phpcbf" + ], + "test": [ + "Composer\\Config::disableProcessTimeout", + "@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php --no-coverage" + ], + "coverage": [ + "Composer\\Config::disableProcessTimeout", + "@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php -d max_execution_time=0" + ], + "build": [ + "Composer\\Config::disableProcessTimeout", + "@php -d phar.readonly=0 -f ./scripts/build-phar.php" + ], + "check-all": [ + "@cs", + "@test" + ] + }, + "scripts-descriptions": { + "cs": "Check for code style violations.", + "cbf": "Fix code style violations.", + "test": "Run the unit tests without code coverage.", + "coverage": "Run the unit tests with code coverage.", + "build": "Create PHAR files for PHPCS and PHPCBF.", + "check-all": "Run all checks (phpcs, tests)." + } } diff --git a/vendor/squizlabs/php_codesniffer/src/Config.php b/vendor/squizlabs/php_codesniffer/src/Config.php index bfca9e1d..141d1bcb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Config.php +++ b/vendor/squizlabs/php_codesniffer/src/Config.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer; @@ -27,7 +27,7 @@ * 2: ruleset and file parsing output * 3: sniff execution output * @property bool $interactive Enable interactive checking mode. - * @property bool $parallel Check files in parallel. + * @property int $parallel Check files in parallel. * @property bool $cache Enable the use of the file cache. * @property bool $cacheFile A file where the cache data should be written * @property bool $colors Display colours in output. @@ -58,6 +58,7 @@ * @property bool $stdin Read content from STDIN instead of supplied files. * @property string $stdinContent Content passed directly to PHPCS on STDIN. * @property string $stdinPath The path to use for content passed on STDIN. + * @property bool $trackTime Whether or not to track sniff run time. * * @property array $extensions File extensions that should be checked, and what tokenizer to use. * E.g., array('inc' => 'PHP'); @@ -80,7 +81,7 @@ class Config * * @var string */ - const VERSION = '3.7.2'; + const VERSION = '3.8.0'; /** * Package stability; either stable, beta or alpha. @@ -89,6 +90,13 @@ class Config */ const STABILITY = 'stable'; + /** + * Default report width when no report width is provided and 'auto' does not yield a valid width. + * + * @var int + */ + const DEFAULT_REPORT_WIDTH = 80; + /** * An array of settings that PHPCS and PHPCBF accept. * @@ -136,6 +144,7 @@ class Config 'stdin' => null, 'stdinContent' => null, 'stdinPath' => null, + 'trackTime' => null, 'unknown' => null, ]; @@ -200,6 +209,22 @@ public function __get($name) throw new RuntimeException("ERROR: unable to get value of property \"$name\""); } + // Figure out what the terminal width needs to be for "auto". + if ($name === 'reportWidth' && $this->settings[$name] === 'auto') { + if (function_exists('shell_exec') === true) { + $dimensions = shell_exec('stty size 2>&1'); + if (is_string($dimensions) === true && preg_match('|\d+ (\d+)|', $dimensions, $matches) === 1) { + $this->settings[$name] = (int) $matches[1]; + } + } + + if ($this->settings[$name] === 'auto') { + // If shell_exec wasn't available or didn't yield a usable value, set to the default. + // This will prevent subsequent retrievals of the reportWidth from making another call to stty. + $this->settings[$name] = self::DEFAULT_REPORT_WIDTH; + } + } + return $this->settings[$name]; }//end __get() @@ -222,16 +247,20 @@ public function __set($name, $value) switch ($name) { case 'reportWidth' : - // Support auto terminal width. - if ($value === 'auto' - && function_exists('shell_exec') === true - && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1 - ) { - $value = (int) $matches[1]; - } else { + if (is_string($value) === true && $value === 'auto') { + // Nothing to do. Leave at 'auto'. + break; + } + + if (is_int($value) === true) { + $value = abs($value); + } else if (is_string($value) === true && preg_match('`^\d+$`', $value) === 1) { $value = (int) $value; + } else { + $value = self::DEFAULT_REPORT_WIDTH; } break; + case 'standards' : $cleaned = []; @@ -250,6 +279,20 @@ public function __set($name, $value) $value = $cleaned; break; + + // Only track time when explicitly needed. + case 'verbosity': + if ($value > 2) { + $this->settings['trackTime'] = true; + } + break; + case 'reports': + $reports = array_change_key_case($value, CASE_LOWER); + if (array_key_exists('performance', $reports) === true) { + $this->settings['trackTime'] = true; + } + break; + default : // No validation required. break; @@ -503,6 +546,7 @@ public function restoreDefaults() $this->stdin = false; $this->stdinContent = null; $this->stdinPath = null; + $this->trackTime = false; $this->unknown = []; $standard = self::getConfigData('default_standard'); @@ -690,7 +734,7 @@ public function processShortArgument($arg, $pos) /** - * Processes a long (--example) command line argument. + * Processes a long (--example) command-line argument. * * @param string $arg The command line argument. * @param int $pos The position of the argument on the command line. @@ -709,7 +753,7 @@ public function processLongArgument($arg, $pos) throw new DeepExitException($output, 0); case 'version': $output = 'PHP_CodeSniffer version '.self::VERSION.' ('.self::STABILITY.') '; - $output .= 'by Squiz (http://www.squiz.net)'.PHP_EOL; + $output .= 'by Squiz and PHPCSStandards'.PHP_EOL; throw new DeepExitException($output, 0); case 'colors': if (isset(self::$overriddenDefaults['colors']) === true) { @@ -1205,13 +1249,17 @@ public function processLongArgument($arg, $pos) if ($this->dieOnUnknownArg === false) { $eqPos = strpos($arg, '='); try { + $unknown = $this->unknown; + if ($eqPos === false) { - $this->values[$arg] = $arg; + $unknown[$arg] = $arg; } else { - $value = substr($arg, ($eqPos + 1)); - $arg = substr($arg, 0, $eqPos); - $this->values[$arg] = $value; + $value = substr($arg, ($eqPos + 1)); + $arg = substr($arg, 0, $eqPos); + $unknown[$arg] = $value; } + + $this->unknown = $unknown; } catch (RuntimeException $e) { // Value is not valid, so just ignore it. } @@ -1389,7 +1437,7 @@ public function printPHPCSUsage() echo ' e.g., module/php,es/js'.PHP_EOL; echo ' One or more files and/or directories to check'.PHP_EOL; echo ' A file containing a list of files and/or directories to check (one per line)'.PHP_EOL; - echo ' Use either the "gitmodified" or "gitstaged" filter,'.PHP_EOL; + echo ' Use either the "GitModified" or "GitStaged" filter,'.PHP_EOL; echo ' or specify the path to a custom filter class'.PHP_EOL; echo ' Use either the "HTML", "Markdown" or "Text" generator'.PHP_EOL; echo ' (forces documentation generation instead of checking)'.PHP_EOL; @@ -1397,8 +1445,8 @@ public function printPHPCSUsage() echo ' How many files should be checked simultaneously (default is 1)'.PHP_EOL; echo ' Print either the "full", "xml", "checkstyle", "csv"'.PHP_EOL; echo ' "json", "junit", "emacs", "source", "summary", "diff"'.PHP_EOL; - echo ' "svnblame", "gitblame", "hgblame" or "notifysend" report,'.PHP_EOL; - echo ' or specify the path to a custom report class'.PHP_EOL; + echo ' "svnblame", "gitblame", "hgblame", "notifysend" or "performance",'.PHP_EOL; + echo ' report or specify the path to a custom report class'.PHP_EOL; echo ' (the "full" report is printed by default)'.PHP_EOL; echo ' Write the report to the specified file path'.PHP_EOL; echo ' How many columns wide screen reports should be printed'.PHP_EOL; @@ -1451,7 +1499,7 @@ public function printPHPCBFUsage() echo ' e.g., module/php,es/js'.PHP_EOL; echo ' One or more files and/or directories to fix'.PHP_EOL; echo ' A file containing a list of files and/or directories to fix (one per line)'.PHP_EOL; - echo ' Use either the "gitmodified" or "gitstaged" filter,'.PHP_EOL; + echo ' Use either the "GitModified" or "GitStaged" filter,'.PHP_EOL; echo ' or specify the path to a custom filter class'.PHP_EOL; echo ' A comma separated list of patterns to ignore files and directories'.PHP_EOL; echo ' How many files should be fixed simultaneously (default is 1)'.PHP_EOL; @@ -1567,13 +1615,6 @@ public static function setConfigData($key, $value, $temp=false) $configFile = dirname($path).DIRECTORY_SEPARATOR.'CodeSniffer.conf'; } else { $configFile = dirname(__DIR__).DIRECTORY_SEPARATOR.'CodeSniffer.conf'; - if (is_file($configFile) === false - && strpos('@data_dir@', '@data_dir') === false - ) { - // If data_dir was replaced, this is a PEAR install and we can - // use the PEAR data dir to store the conf file. - $configFile = '@data_dir@/PHP_CodeSniffer/CodeSniffer.conf'; - } } if (is_file($configFile) === true diff --git a/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php b/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php index b1440944..7732c6da 100644 --- a/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php +++ b/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Exceptions; diff --git a/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php b/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php index 093bf13d..a3d59098 100644 --- a/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php +++ b/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Exceptions; diff --git a/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php b/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php index ceba00cc..ad25ace1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php +++ b/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Exceptions; diff --git a/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php b/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php index 60143030..eb947fd2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php +++ b/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php @@ -9,7 +9,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Files/File.php b/vendor/squizlabs/php_codesniffer/src/Files/File.php index ad1ca0b2..eb2357a1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Files/File.php +++ b/vendor/squizlabs/php_codesniffer/src/Files/File.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Files; @@ -209,6 +209,7 @@ class File * An array of sniffs being processed and how long they took. * * @var array + * @see getListenerTimes() */ protected $listenerTimes = []; @@ -253,6 +254,7 @@ public function __construct($path, Ruleset $ruleset, Config $config) $this->configCache['errorSeverity'] = $this->config->errorSeverity; $this->configCache['warningSeverity'] = $this->config->warningSeverity; $this->configCache['recordErrors'] = $this->config->recordErrors; + $this->configCache['trackTime'] = $this->config->trackTime; $this->configCache['ignorePatterns'] = $this->ruleset->ignorePatterns; $this->configCache['includePatterns'] = $this->ruleset->includePatterns; @@ -343,6 +345,7 @@ public function process() $listenerIgnoreTo = []; $inTests = defined('PHP_CODESNIFFER_IN_TESTS'); $checkAnnotations = $this->config->annotations; + $annotationErrors = []; // Foreach of the listeners that have registered to listen for this // token, get them to process it. @@ -379,9 +382,12 @@ public function process() if (isset($this->ruleset->sniffCodes[$parts[0]]) === true) { $listenerCode = array_shift($parts); $propertyCode = array_shift($parts); - $propertyValue = rtrim(implode(' ', $parts), " */\r\n"); + $settings = [ + 'value' => rtrim(implode(' ', $parts), " */\r\n"), + 'scope' => 'sniff', + ]; $listenerClass = $this->ruleset->sniffCodes[$listenerCode]; - $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $propertyValue); + $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $settings); } } } @@ -403,9 +409,20 @@ public function process() $listenerCode = $token['sniffCode']; if (isset($this->ruleset->sniffCodes[$listenerCode]) === true) { $propertyCode = $token['sniffProperty']; - $propertyValue = $token['sniffPropertyValue']; + $settings = [ + 'value' => $token['sniffPropertyValue'], + 'scope' => 'sniff', + ]; $listenerClass = $this->ruleset->sniffCodes[$listenerCode]; - $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $propertyValue); + try { + $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $settings); + } catch (RuntimeException $e) { + // Non-existant property being set via an inline annotation. + // This is typically a PHPCS test case file, but we can't throw an error on the annotation + // line as it would get ignored. We also don't want this error to block + // the scan of the current file, so collect these and throw later. + $annotationErrors[] = 'Line '.$token['line'].': '.str_replace('Ruleset invalid. ', '', $e->getMessage()); + } } } }//end if @@ -490,8 +507,11 @@ public function process() $this->activeListener = $class; - if (PHP_CODESNIFFER_VERBOSITY > 2) { + if ($this->configCache['trackTime'] === true) { $startTime = microtime(true); + } + + if (PHP_CODESNIFFER_VERBOSITY > 2) { echo "\t\t\tProcessing ".$this->activeListener.'... '; } @@ -500,14 +520,16 @@ public function process() $listenerIgnoreTo[$this->activeListener] = $ignoreTo; } - if (PHP_CODESNIFFER_VERBOSITY > 2) { + if ($this->configCache['trackTime'] === true) { $timeTaken = (microtime(true) - $startTime); if (isset($this->listenerTimes[$this->activeListener]) === false) { $this->listenerTimes[$this->activeListener] = 0; } $this->listenerTimes[$this->activeListener] += $timeTaken; + } + if (PHP_CODESNIFFER_VERBOSITY > 2) { $timeTaken = round(($timeTaken), 4); echo "DONE in $timeTaken seconds".PHP_EOL; } @@ -530,12 +552,18 @@ public function process() } } + if ($annotationErrors !== []) { + $error = 'Encountered invalid inline phpcs:set annotations. Found:'.PHP_EOL; + $error .= implode(PHP_EOL, $annotationErrors); + + $this->addWarning($error, null, 'Internal.PropertyDoesNotExist'); + } + if (PHP_CODESNIFFER_VERBOSITY > 2) { echo "\t*** END TOKEN PROCESSING ***".PHP_EOL; echo "\t*** START SNIFF PROCESSING REPORT ***".PHP_EOL; - asort($this->listenerTimes, SORT_NUMERIC); - $this->listenerTimes = array_reverse($this->listenerTimes, true); + arsort($this->listenerTimes, SORT_NUMERIC); foreach ($this->listenerTimes as $listener => $timeTaken) { echo "\t$listener: ".round(($timeTaken), 4).' secs'.PHP_EOL; } @@ -733,7 +761,7 @@ public function addErrorOnLine( /** - * Records a warning against a specific token in the file. + * Records a warning against a specific line in the file. * * @param string $warning The error message. * @param int $line The line on which the warning occurred. @@ -1210,6 +1238,18 @@ public function getMetrics() }//end getMetrics() + /** + * Returns the time taken processing this file for each invoked sniff. + * + * @return array + */ + public function getListenerTimes() + { + return $this->listenerTimes; + + }//end getListenerTimes() + + /** * Returns the absolute filename of this file. * @@ -1281,25 +1321,25 @@ public function getDeclarationName($stackPtr) * * * 0 => array( - * 'name' => '$var', // The variable name. - * 'token' => integer, // The stack pointer to the variable name. - * 'content' => string, // The full content of the variable definition. - * 'has_attributes' => boolean, // Does the parameter have one or more attributes attached ? - * 'pass_by_reference' => boolean, // Is the variable passed by reference? - * 'reference_token' => integer, // The stack pointer to the reference operator - * // or FALSE if the param is not passed by reference. - * 'variable_length' => boolean, // Is the param of variable length through use of `...` ? - * 'variadic_token' => integer, // The stack pointer to the ... operator - * // or FALSE if the param is not variable length. - * 'type_hint' => string, // The type hint for the variable. - * 'type_hint_token' => integer, // The stack pointer to the start of the type hint - * // or FALSE if there is no type hint. - * 'type_hint_end_token' => integer, // The stack pointer to the end of the type hint - * // or FALSE if there is no type hint. - * 'nullable_type' => boolean, // TRUE if the type is preceded by the nullability - * // operator. - * 'comma_token' => integer, // The stack pointer to the comma after the param - * // or FALSE if this is the last param. + * 'name' => string, // The variable name. + * 'token' => integer, // The stack pointer to the variable name. + * 'content' => string, // The full content of the variable definition. + * 'has_attributes' => boolean, // Does the parameter have one or more attributes attached ? + * 'pass_by_reference' => boolean, // Is the variable passed by reference? + * 'reference_token' => integer|false, // The stack pointer to the reference operator + * // or FALSE if the param is not passed by reference. + * 'variable_length' => boolean, // Is the param of variable length through use of `...` ? + * 'variadic_token' => integer|false, // The stack pointer to the ... operator + * // or FALSE if the param is not variable length. + * 'type_hint' => string, // The type hint for the variable. + * 'type_hint_token' => integer|false, // The stack pointer to the start of the type hint + * // or FALSE if there is no type hint. + * 'type_hint_end_token' => integer|false, // The stack pointer to the end of the type hint + * // or FALSE if there is no type hint. + * 'nullable_type' => boolean, // TRUE if the type is preceded by the nullability + * // operator. + * 'comma_token' => integer|false, // The stack pointer to the comma after the param + * // or FALSE if this is the last param. * ) * * @@ -1309,10 +1349,12 @@ public function getDeclarationName($stackPtr) * 'default_equal_token' => integer, // The stack pointer to the equals sign. * * Parameters declared using PHP 8 constructor property promotion, have these additional array indexes: - * 'property_visibility' => string, // The property visibility as declared. - * 'visibility_token' => integer, // The stack pointer to the visibility modifier token. - * 'property_readonly' => bool, // TRUE if the readonly keyword was found. - * 'readonly_token' => integer, // The stack pointer to the readonly modifier token. + * 'property_visibility' => string, // The property visibility as declared. + * 'visibility_token' => integer|false, // The stack pointer to the visibility modifier token + * // or FALSE if the visibility is not explicitly declared. + * 'property_readonly' => boolean, // TRUE if the readonly keyword was found. + * 'readonly_token' => integer, // The stack pointer to the readonly modifier token. + * // This index will only be set if the property is readonly. * * @param int $stackPtr The position in the stack of the function token * to acquire the parameters for. @@ -1471,6 +1513,7 @@ public function getMethodParameters($stackPtr) case T_TYPE_UNION: case T_TYPE_INTERSECTION: case T_FALSE: + case T_TRUE: case T_NULL: // Part of a type hint or default value. if ($defaultStart === null) { @@ -1530,15 +1573,20 @@ public function getMethodParameters($stackPtr) $vars[$paramCount]['type_hint_end_token'] = $typeHintEndToken; $vars[$paramCount]['nullable_type'] = $nullableType; - if ($visibilityToken !== null) { - $vars[$paramCount]['property_visibility'] = $this->tokens[$visibilityToken]['content']; - $vars[$paramCount]['visibility_token'] = $visibilityToken; + if ($visibilityToken !== null || $readonlyToken !== null) { + $vars[$paramCount]['property_visibility'] = 'public'; + $vars[$paramCount]['visibility_token'] = false; $vars[$paramCount]['property_readonly'] = false; - } - if ($readonlyToken !== null) { - $vars[$paramCount]['property_readonly'] = true; - $vars[$paramCount]['readonly_token'] = $readonlyToken; + if ($visibilityToken !== null) { + $vars[$paramCount]['property_visibility'] = $this->tokens[$visibilityToken]['content']; + $vars[$paramCount]['visibility_token'] = $visibilityToken; + } + + if ($readonlyToken !== null) { + $vars[$paramCount]['property_readonly'] = true; + $vars[$paramCount]['readonly_token'] = $readonlyToken; + } } if ($this->tokens[$i]['code'] === T_COMMA) { @@ -1584,19 +1632,19 @@ public function getMethodParameters($stackPtr) * The format of the return value is: * * array( - * 'scope' => 'public', // Public, private, or protected - * 'scope_specified' => true, // TRUE if the scope keyword was found. - * 'return_type' => '', // The return type of the method. - * 'return_type_token' => integer, // The stack pointer to the start of the return type - * // or FALSE if there is no return type. - * 'return_type_end_token' => integer, // The stack pointer to the end of the return type - * // or FALSE if there is no return type. - * 'nullable_return_type' => false, // TRUE if the return type is preceded by the - * // nullability operator. - * 'is_abstract' => false, // TRUE if the abstract keyword was found. - * 'is_final' => false, // TRUE if the final keyword was found. - * 'is_static' => false, // TRUE if the static keyword was found. - * 'has_body' => false, // TRUE if the method has a body + * 'scope' => string, // Public, private, or protected + * 'scope_specified' => boolean, // TRUE if the scope keyword was found. + * 'return_type' => string, // The return type of the method. + * 'return_type_token' => integer|false, // The stack pointer to the start of the return type + * // or FALSE if there is no return type. + * 'return_type_end_token' => integer|false, // The stack pointer to the end of the return type + * // or FALSE if there is no return type. + * 'nullable_return_type' => boolean, // TRUE if the return type is preceded by the + * // nullability operator. + * 'is_abstract' => boolean, // TRUE if the abstract keyword was found. + * 'is_final' => boolean, // TRUE if the final keyword was found. + * 'is_static' => boolean, // TRUE if the static keyword was found. + * 'has_body' => boolean, // TRUE if the method has a body * ); * * @@ -1692,6 +1740,7 @@ public function getMethodProperties($stackPtr) T_PARENT => T_PARENT, T_STATIC => T_STATIC, T_FALSE => T_FALSE, + T_TRUE => T_TRUE, T_NULL => T_NULL, T_NAMESPACE => T_NAMESPACE, T_NS_SEPARATOR => T_NS_SEPARATOR, @@ -1758,17 +1807,17 @@ public function getMethodProperties($stackPtr) * * * array( - * 'scope' => string, // Public, private, or protected. - * 'scope_specified' => boolean, // TRUE if the scope was explicitly specified. - * 'is_static' => boolean, // TRUE if the static keyword was found. - * 'is_readonly' => boolean, // TRUE if the readonly keyword was found. - * 'type' => string, // The type of the var (empty if no type specified). - * 'type_token' => integer, // The stack pointer to the start of the type - * // or FALSE if there is no type. - * 'type_end_token' => integer, // The stack pointer to the end of the type - * // or FALSE if there is no type. - * 'nullable_type' => boolean, // TRUE if the type is preceded by the nullability - * // operator. + * 'scope' => string, // Public, private, or protected. + * 'scope_specified' => boolean, // TRUE if the scope was explicitly specified. + * 'is_static' => boolean, // TRUE if the static keyword was found. + * 'is_readonly' => boolean, // TRUE if the readonly keyword was found. + * 'type' => string, // The type of the var (empty if no type specified). + * 'type_token' => integer|false, // The stack pointer to the start of the type + * // or FALSE if there is no type. + * 'type_end_token' => integer|false, // The stack pointer to the end of the type + * // or FALSE if there is no type. + * 'nullable_type' => boolean, // TRUE if the type is preceded by the nullability + * // operator. * ); * * @@ -1893,6 +1942,7 @@ public function getMemberProperties($stackPtr) T_SELF => T_SELF, T_PARENT => T_PARENT, T_FALSE => T_FALSE, + T_TRUE => T_TRUE, T_NULL => T_NULL, T_NAMESPACE => T_NAMESPACE, T_NS_SEPARATOR => T_NS_SEPARATOR, @@ -1945,8 +1995,9 @@ public function getMemberProperties($stackPtr) * The format of the return value is: * * array( - * 'is_abstract' => false, // true if the abstract keyword was found. - * 'is_final' => false, // true if the final keyword was found. + * 'is_abstract' => boolean, // TRUE if the abstract keyword was found. + * 'is_final' => boolean, // TRUE if the final keyword was found. + * 'is_readonly' => boolean, // TRUE if the readonly keyword was found. * ); * * @@ -1966,6 +2017,7 @@ public function getClassProperties($stackPtr) $valid = [ T_FINAL => T_FINAL, T_ABSTRACT => T_ABSTRACT, + T_READONLY => T_READONLY, T_WHITESPACE => T_WHITESPACE, T_COMMENT => T_COMMENT, T_DOC_COMMENT => T_DOC_COMMENT, @@ -1973,6 +2025,7 @@ public function getClassProperties($stackPtr) $isAbstract = false; $isFinal = false; + $isReadonly = false; for ($i = ($stackPtr - 1); $i > 0; $i--) { if (isset($valid[$this->tokens[$i]['code']]) === false) { @@ -1987,12 +2040,17 @@ public function getClassProperties($stackPtr) case T_FINAL: $isFinal = true; break; + + case T_READONLY: + $isReadonly = true; + break; } }//end for return [ 'is_abstract' => $isAbstract, 'is_final' => $isFinal, + 'is_readonly' => $isReadonly, ]; }//end getClassProperties() diff --git a/vendor/squizlabs/php_codesniffer/src/Files/FileList.php b/vendor/squizlabs/php_codesniffer/src/Files/FileList.php index 66833a3e..13357ecd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Files/FileList.php +++ b/vendor/squizlabs/php_codesniffer/src/Files/FileList.php @@ -6,7 +6,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Files; @@ -199,7 +199,7 @@ public function current() /** * Return the file path of the current file being processed. * - * @return void + * @return string|null Path name or `null` when the end of the iterator has been reached. */ #[ReturnTypeWillChange] public function key() diff --git a/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php b/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php index ca2e74ad..c2af77c4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php +++ b/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php b/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php index 13af8ff2..38a2f05b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php +++ b/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php @@ -6,7 +6,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Filters; diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php b/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php index a1246a2c..c72518c6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php +++ b/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Filters; diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php b/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php index 4b6ef3fc..9bba997c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php +++ b/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Filters; diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php b/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php index fcb92c3d..1fdbb952 100644 --- a/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php +++ b/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php @@ -6,7 +6,7 @@ * * @author Juliette Reinders Folmer * @copyright 2018 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Filters; diff --git a/vendor/squizlabs/php_codesniffer/src/Fixer.php b/vendor/squizlabs/php_codesniffer/src/Fixer.php index b8dc05b1..b54dde94 100644 --- a/vendor/squizlabs/php_codesniffer/src/Fixer.php +++ b/vendor/squizlabs/php_codesniffer/src/Fixer.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer; @@ -70,7 +70,7 @@ class Fixer * If a token is being "fixed" back to its last value, the fix is * probably conflicting with another. * - * @var array + * @var array> */ private $oldTokenValues = []; @@ -349,7 +349,7 @@ public function getTokenContent($stackPtr) /** * Start recording actions for a changeset. * - * @return void + * @return void|false */ public function beginChangeset() { diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php b/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php index 56049768..483cae80 100644 --- a/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php +++ b/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Generators; diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php b/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php index db264684..55acd9e1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php +++ b/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php @@ -8,7 +8,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Generators; @@ -169,7 +169,7 @@ protected function printFooter() $errorLevel = error_reporting(0); echo '
'; echo 'Documentation generated on '.date('r'); - echo ' by PHP_CodeSniffer '.Config::VERSION.''; + echo ' by PHP_CodeSniffer '.Config::VERSION.''; echo '
'.PHP_EOL; error_reporting($errorLevel); diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php b/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php index 9756bcf1..23bed27e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php +++ b/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php @@ -4,7 +4,7 @@ * * @author Stefano Kowalke * @copyright 2014 Arroba IT - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Generators; @@ -67,7 +67,7 @@ protected function printFooter() // don't have their timezone set. error_reporting(0); echo 'Documentation generated on '.date('r'); - echo ' by [PHP_CodeSniffer '.Config::VERSION.'](https://github.com/squizlabs/PHP_CodeSniffer)'.PHP_EOL; + echo ' by [PHP_CodeSniffer '.Config::VERSION.'](https://github.com/PHPCSStandards/PHP_CodeSniffer)'.PHP_EOL; }//end printFooter() diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/Text.php b/vendor/squizlabs/php_codesniffer/src/Generators/Text.php index ffff206a..7ec95ec9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Generators/Text.php +++ b/vendor/squizlabs/php_codesniffer/src/Generators/Text.php @@ -6,7 +6,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Generators; diff --git a/vendor/squizlabs/php_codesniffer/src/Reporter.php b/vendor/squizlabs/php_codesniffer/src/Reporter.php index e89a20ed..3e3da321 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reporter.php +++ b/vendor/squizlabs/php_codesniffer/src/Reporter.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer; diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php b/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php index 0ecde76e..b84f69f6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php @@ -8,7 +8,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -28,10 +28,10 @@ class Cbf implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool * @throws \PHP_CodeSniffer\Exceptions\DeepExitException diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php b/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php index 06a78e19..dc1f6cc7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Checkstyle implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Code.php b/vendor/squizlabs/php_codesniffer/src/Reports/Code.php index 47c5581e..23827058 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Code.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Code.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Code implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php b/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php index 6db7ecfc..aef7d7e3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -22,10 +22,10 @@ class Csv implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php b/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php index ce4b31fc..03f7bf20 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -22,10 +22,10 @@ class Diff implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php b/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php index 3555f554..3f003657 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -22,10 +22,10 @@ class Emacs implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Full.php b/vendor/squizlabs/php_codesniffer/src/Reports/Full.php index 084bc8aa..f6db5833 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Full.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Full.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Full implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php b/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php index 6427567f..3beb3452 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php @@ -5,7 +5,7 @@ * @author Ben Selby * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -70,7 +70,7 @@ protected function getBlameContent($filename) $cwd = getcwd(); chdir(dirname($filename)); - $command = 'git blame --date=short "'.$filename.'" 2>&1'; + $command = 'git blame --date=short "'.basename($filename).'" 2>&1'; $handle = popen($command, 'r'); if ($handle === false) { $error = 'ERROR: Could not execute "'.$command.'"'.PHP_EOL.PHP_EOL; diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php b/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php index f88a0683..2d98c46d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php @@ -5,7 +5,7 @@ * @author Ben Selby * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -28,7 +28,7 @@ class Hgblame extends VersionControl * * @param string $line Line to parse. * - * @return mixed string or false if impossible to recover. + * @return string|false String or FALSE if impossible to recover. */ protected function getAuthor($line) { diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Info.php b/vendor/squizlabs/php_codesniffer/src/Reports/Info.php index 3181bcc5..40390561 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Info.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Info.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Info implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ @@ -45,7 +45,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false, /** - * Prints the source of all errors and warnings. + * Prints the recorded metrics. * * @param string $cachedData Any partial report data that was returned from * generateFileReport during the run. diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Json.php b/vendor/squizlabs/php_codesniffer/src/Reports/Json.php index 59d8f305..0b9ad34f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Json.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Json.php @@ -5,7 +5,7 @@ * @author Jeffrey Fisher * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Json implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php b/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php index d3ede61d..40145a71 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php @@ -5,7 +5,7 @@ * @author Oleg Lobach * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -24,10 +24,10 @@ class Junit implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php b/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php index 08416622..1c296958 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php @@ -11,7 +11,7 @@ * @author Greg Sherwood * @copyright 2012-2014 Christian Weiske * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -88,10 +88,10 @@ public function __construct() * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ @@ -154,7 +154,7 @@ public function generate( * @param int $totalErrors Total number of errors found during the run. * @param int $totalWarnings Total number of warnings found during the run. * - * @return string Error message or NULL if no error/warning found. + * @return string|null Error message or NULL if no error/warning found. */ protected function generateMessage($checkedFiles, $totalErrors, $totalWarnings) { diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Performance.php b/vendor/squizlabs/php_codesniffer/src/Reports/Performance.php new file mode 100644 index 00000000..d5b94074 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Performance.php @@ -0,0 +1,160 @@ + + * @copyright 2023 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Reports; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Common; +use PHP_CodeSniffer\Util\Timing; + +class Performance implements Report +{ + + + /** + * Generate a partial report for a single processed file. + * + * Function should return TRUE if it printed or stored data about the file + * and FALSE if it ignored the file. Returning TRUE indicates that the file and + * its data should be counted in the grand totals. + * + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. + * + * @return bool + */ + public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) + { + $times = $phpcsFile->getListenerTimes(); + foreach ($times as $sniff => $time) { + echo "$sniff>>$time".PHP_EOL; + } + + return true; + + }//end generateFileReport() + + + /** + * Prints the sniff performance report. + * + * @param string $cachedData Any partial report data that was returned from + * generateFileReport during the run. + * @param int $totalFiles Total number of files processed during the run. + * @param int $totalErrors Total number of errors found during the run. + * @param int $totalWarnings Total number of warnings found during the run. + * @param int $totalFixable Total number of problems that can be fixed. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. + * @param bool $interactive Are we running in interactive mode? + * @param bool $toScreen Is the report being printed to screen? + * + * @return void + */ + public function generate( + $cachedData, + $totalFiles, + $totalErrors, + $totalWarnings, + $totalFixable, + $showSources=false, + $width=80, + $interactive=false, + $toScreen=true + ) { + $lines = explode(PHP_EOL, $cachedData); + array_pop($lines); + + if (empty($lines) === true) { + return; + } + + // First collect the accumulated timings. + $timings = []; + $totalSniffTime = 0; + foreach ($lines as $line) { + $parts = explode('>>', $line); + $sniffClass = $parts[0]; + $time = $parts[1]; + + if (isset($timings[$sniffClass]) === false) { + $timings[$sniffClass] = 0; + } + + $timings[$sniffClass] += $time; + $totalSniffTime += $time; + } + + // Next, tidy up the sniff names and determine max needed column width. + $totalTimes = []; + $maxNameWidth = 0; + foreach ($timings as $sniffClass => $secs) { + $sniffCode = Common::getSniffCode($sniffClass); + $maxNameWidth = max($maxNameWidth, strlen($sniffCode)); + $totalTimes[$sniffCode] = $secs; + } + + // Leading space + up to 12 chars for the number. + $maxTimeWidth = 13; + // Leading space, open parenthesis, up to 5 chars for the number, space + % and close parenthesis. + $maxPercWidth = 10; + // Calculate the maximum width available for the sniff name. + $maxNameWidth = min(($width - $maxTimeWidth - $maxPercWidth), max(($width - $maxTimeWidth - $maxPercWidth), $maxNameWidth)); + + arsort($totalTimes); + + echo PHP_EOL."\033[1m".'PHP CODE SNIFFER SNIFF PERFORMANCE REPORT'."\033[0m".PHP_EOL; + echo str_repeat('-', $width).PHP_EOL; + echo "\033[1m".'SNIFF'.str_repeat(' ', ($width - 31)).'TIME TAKEN (SECS) (%)'."\033[0m".PHP_EOL; + echo str_repeat('-', $width).PHP_EOL; + + // Mark sniffs which take more than twice as long as the average processing time per sniff + // in orange and when they take more than three times as long as the average, + // mark them in red. + $avgSniffTime = ($totalSniffTime / count($totalTimes)); + $doubleAvgSniffTime = (2 * $avgSniffTime); + $tripleAvgSniffTime = (3 * $avgSniffTime); + + $format = "%- {$maxNameWidth}.{$maxNameWidth}s % 12.6f (% 5.1f %%)".PHP_EOL; + $formatBold = "\033[1m%- {$maxNameWidth}.{$maxNameWidth}s % 12.6f (% 5.1f %%)\033[0m".PHP_EOL; + $formatWarning = "%- {$maxNameWidth}.{$maxNameWidth}s \033[33m% 12.6f (% 5.1f %%)\033[0m".PHP_EOL; + $formatError = "%- {$maxNameWidth}.{$maxNameWidth}s \033[31m% 12.6f (% 5.1f %%)\033[0m".PHP_EOL; + + foreach ($totalTimes as $sniff => $time) { + $percent = round((($time / $totalSniffTime) * 100), 1); + + if ($time > $tripleAvgSniffTime) { + printf($formatError, $sniff, $time, $percent); + } else if ($time > $doubleAvgSniffTime) { + printf($formatWarning, $sniff, $time, $percent); + } else { + printf($format, $sniff, $time, $percent); + } + } + + echo str_repeat('-', $width).PHP_EOL; + printf($formatBold, 'TOTAL SNIFF PROCESSING TIME', $totalSniffTime, 100); + + $runTime = (Timing::getDuration() / 1000); + $phpcsTime = ($runTime - $totalSniffTime); + + echo PHP_EOL.str_repeat('-', $width).PHP_EOL; + printf($format, 'Time taken by sniffs', $totalSniffTime, round((($totalSniffTime / $runTime) * 100), 1)); + printf($format, 'Time taken by PHPCS runner', $phpcsTime, round((($phpcsTime / $runTime) * 100), 1)); + + echo str_repeat('-', $width).PHP_EOL; + printf($formatBold, 'TOTAL RUN TIME', $runTime, 100); + echo str_repeat('-', $width).PHP_EOL; + + }//end generate() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Report.php b/vendor/squizlabs/php_codesniffer/src/Reports/Report.php index 38f8a629..eec5eb1d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Report.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Report.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -22,10 +22,10 @@ interface Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Source.php b/vendor/squizlabs/php_codesniffer/src/Reports/Source.php index ce8c3cfe..6aa891a4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Source.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Source.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Source implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php b/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php index 8fe18e76..d2927a1c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Summary implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php b/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php index a7f65e15..b44e83d6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php b/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php index 0f414567..e3ad74b8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php @@ -5,7 +5,7 @@ * @author Ben Selby * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -31,16 +31,16 @@ abstract class VersionControl implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) { - $blames = $this->getBlameContent($report['filename']); + $blames = $this->getBlameContent($phpcsFile->getFilename()); $authorCache = []; $praiseCache = []; diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php b/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php index 066383de..dc25bba3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Reports; @@ -23,10 +23,10 @@ class Xml implements Report * and FALSE if it ignored the file. Returning TRUE indicates that the file and * its data should be counted in the grand totals. * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. + * @param array $report Prepared report data. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on. + * @param bool $showSources Show sources? + * @param int $width Maximum allowed line width. * * @return bool */ diff --git a/vendor/squizlabs/php_codesniffer/src/Ruleset.php b/vendor/squizlabs/php_codesniffer/src/Ruleset.php index f90e7b6d..901fb8e0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Ruleset.php +++ b/vendor/squizlabs/php_codesniffer/src/Ruleset.php @@ -6,13 +6,14 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer; use PHP_CodeSniffer\Exceptions\RuntimeException; use PHP_CodeSniffer\Util; +use stdClass; class Ruleset { @@ -46,7 +47,7 @@ class Ruleset * The key is the regular expression and the value is the type * of ignore pattern (absolute or relative). * - * @var array + * @var array */ public $ignorePatterns = []; @@ -237,16 +238,12 @@ public function __construct(Config $config) public function explain() { $sniffs = array_keys($this->sniffCodes); - sort($sniffs); - - ob_start(); + sort($sniffs, (SORT_NATURAL | SORT_FLAG_CASE)); - $lastStandard = null; - $lastCount = ''; - $sniffCount = count($sniffs); + $sniffCount = count($sniffs); - // Add a dummy entry to the end so we loop - // one last time and clear the output buffer. + // Add a dummy entry to the end so we loop one last time + // and echo out the collected info about the last standard. $sniffs[] = ''; $summaryLine = PHP_EOL."The $this->name standard contains 1 sniff".PHP_EOL; @@ -256,7 +253,9 @@ public function explain() echo $summaryLine; - ob_start(); + $lastStandard = null; + $lastCount = 0; + $sniffsInStandard = []; foreach ($sniffs as $i => $sniff) { if ($i === $sniffCount) { @@ -268,32 +267,31 @@ public function explain() } } + // Reached the first item in the next standard. + // Echo out the info collected from the previous standard. if ($currentStandard !== $lastStandard) { - $sniffList = ob_get_contents(); - ob_end_clean(); - - echo PHP_EOL.$lastStandard.' ('.$lastCount.' sniff'; + $subTitle = $lastStandard.' ('.$lastCount.' sniff'; if ($lastCount > 1) { - echo 's'; + $subTitle .= 's'; } - echo ')'.PHP_EOL; - echo str_repeat('-', (strlen($lastStandard.$lastCount) + 10)); - echo PHP_EOL; - echo $sniffList; + $subTitle .= ')'; - $lastStandard = $currentStandard; - $lastCount = 0; + echo PHP_EOL.$subTitle.PHP_EOL; + echo str_repeat('-', strlen($subTitle)).PHP_EOL; + echo ' '.implode(PHP_EOL.' ', $sniffsInStandard).PHP_EOL; + + $lastStandard = $currentStandard; + $lastCount = 0; + $sniffsInStandard = []; if ($currentStandard === null) { break; } - - ob_start(); }//end if - echo ' '.$sniff.PHP_EOL; - $lastCount++; + $sniffsInStandard[] = $sniff; + ++$lastCount; }//end foreach }//end explain() @@ -960,6 +958,11 @@ private function processRule($rule, $newSniffs, $depth=0) if (isset($rule->properties) === true && $this->shouldProcessElement($rule->properties) === true ) { + $propertyScope = 'standard'; + if ($code === $ref || substr($ref, -9) === 'Sniff.php') { + $propertyScope = 'sniff'; + } + foreach ($rule->properties->property as $prop) { if ($this->shouldProcessElement($prop) === false) { continue; @@ -980,9 +983,9 @@ private function processRule($rule, $newSniffs, $depth=0) $values = []; if (isset($prop['extend']) === true && (string) $prop['extend'] === 'true' - && isset($this->ruleset[$code]['properties'][$name]) === true + && isset($this->ruleset[$code]['properties'][$name]['value']) === true ) { - $values = $this->ruleset[$code]['properties'][$name]; + $values = $this->ruleset[$code]['properties'][$name]['value']; } if (isset($prop->element) === true) { @@ -1017,7 +1020,10 @@ private function processRule($rule, $newSniffs, $depth=0) } }//end if - $this->ruleset[$code]['properties'][$name] = $values; + $this->ruleset[$code]['properties'][$name] = [ + 'value' => $values, + 'scope' => $propertyScope, + ]; if (PHP_CODESNIFFER_VERBOSITY > 1) { echo str_repeat("\t", $depth); echo "\t\t=> array property \"$name\" set to \"$printValue\""; @@ -1028,7 +1034,10 @@ private function processRule($rule, $newSniffs, $depth=0) echo PHP_EOL; } } else { - $this->ruleset[$code]['properties'][$name] = (string) $prop['value']; + $this->ruleset[$code]['properties'][$name] = [ + 'value' => (string) $prop['value'], + 'scope' => $propertyScope, + ]; if (PHP_CODESNIFFER_VERBOSITY > 1) { echo str_repeat("\t", $depth); echo "\t\t=> property \"$name\" set to \"".(string) $prop['value'].'"'; @@ -1218,8 +1227,8 @@ public function populateTokenListeners() // Set custom properties. if (isset($this->ruleset[$sniffCode]['properties']) === true) { - foreach ($this->ruleset[$sniffCode]['properties'] as $name => $value) { - $this->setSniffProperty($sniffClass, $name, $value); + foreach ($this->ruleset[$sniffCode]['properties'] as $name => $settings) { + $this->setSniffProperty($sniffClass, $name, $settings); } } @@ -1286,18 +1295,76 @@ public function populateTokenListeners() * * @param string $sniffClass The class name of the sniff. * @param string $name The name of the property to change. - * @param string $value The new value of the property. + * @param array $settings Array with the new value of the property and the scope of the property being set. * * @return void + * + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException When attempting to set a non-existent property on a sniff + * which doesn't declare the property or explicitly supports + * dynamic properties. */ - public function setSniffProperty($sniffClass, $name, $value) + public function setSniffProperty($sniffClass, $name, $settings) { // Setting a property for a sniff we are not using. if (isset($this->sniffs[$sniffClass]) === false) { return; } - $name = trim($name); + $name = trim($name); + $propertyName = $name; + if (substr($propertyName, -2) === '[]') { + $propertyName = substr($propertyName, 0, -2); + } + + /* + * BC-compatibility layer for $settings using the pre-PHPCS 3.8.0 format. + * + * Prior to PHPCS 3.8.0, `$settings` was expected to only contain the new _value_ + * for the property (which could be an array). + * Since PHPCS 3.8.0, `$settings` is expected to be an array with two keys: 'scope' + * and 'value', where 'scope' indicates whether the property should be set to the given 'value' + * for one individual sniff or for all sniffs in a standard. + * + * This BC-layer is only for integrations with PHPCS which may call this method directly + * and will be removed in PHPCS 4.0.0. + */ + + if (is_array($settings) === false + || isset($settings['scope'], $settings['value']) === false + ) { + // This will be an "old" format value. + $settings = [ + 'value' => $settings, + 'scope' => 'standard', + ]; + + trigger_error( + __FUNCTION__.': the format of the $settings parameter has changed from (mixed) $value to array(\'scope\' => \'sniff|standard\', \'value\' => $value). Please update your integration code. See PR #3629 for more information.', + E_USER_DEPRECATED + ); + } + + $isSettable = false; + $sniffObject = $this->sniffs[$sniffClass]; + if (property_exists($sniffObject, $propertyName) === true + || ($sniffObject instanceof stdClass) === true + || method_exists($sniffObject, '__set') === true + ) { + $isSettable = true; + } + + if ($isSettable === false) { + if ($settings['scope'] === 'sniff') { + $notice = "Ruleset invalid. Property \"$propertyName\" does not exist on sniff "; + $notice .= array_search($sniffClass, $this->sniffCodes, true); + throw new RuntimeException($notice); + } + + return; + } + + $value = $settings['value']; + if (is_string($value) === true) { $value = trim($value); } @@ -1312,7 +1379,7 @@ public function setSniffProperty($sniffClass, $name, $value) } else if ($value === 'false') { $value = false; } else if (substr($name, -2) === '[]') { - $name = substr($name, 0, -2); + $name = $propertyName; $values = []; if ($value !== null) { foreach (explode(',', $value) as $val) { @@ -1328,7 +1395,7 @@ public function setSniffProperty($sniffClass, $name, $value) $value = $values; } - $this->sniffs[$sniffClass]->$name = $value; + $sniffObject->$name = $value; }//end setSniffProperty() diff --git a/vendor/squizlabs/php_codesniffer/src/Runner.php b/vendor/squizlabs/php_codesniffer/src/Runner.php index e0cbca71..107da181 100644 --- a/vendor/squizlabs/php_codesniffer/src/Runner.php +++ b/vendor/squizlabs/php_codesniffer/src/Runner.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer; @@ -49,7 +49,7 @@ class Runner /** * Run the PHPCS script. * - * @return array + * @return int */ public function runPHPCS() { @@ -151,7 +151,7 @@ public function runPHPCS() /** * Run the PHPCBF script. * - * @return array + * @return int */ public function runPHPCBF() { @@ -595,7 +595,7 @@ private function run() * @param string $file The path of the file that raised the error. * @param int $line The line number the error was raised at. * - * @return void + * @return bool * @throws \PHP_CodeSniffer\Exceptions\RuntimeException */ public function handleErrors($code, $message, $file, $line) @@ -652,6 +652,39 @@ public function processFile($file) } } catch (\Exception $e) { $error = 'An error occurred during processing; checking has been aborted. The error message was: '.$e->getMessage(); + + // Determine which sniff caused the error. + $sniffStack = null; + $nextStack = null; + foreach ($e->getTrace() as $step) { + if (isset($step['file']) === false) { + continue; + } + + if (empty($sniffStack) === false) { + $nextStack = $step; + break; + } + + if (substr($step['file'], -9) === 'Sniff.php') { + $sniffStack = $step; + continue; + } + } + + if (empty($sniffStack) === false) { + if (empty($nextStack) === false + && isset($nextStack['class']) === true + && substr($nextStack['class'], -5) === 'Sniff' + ) { + $sniffCode = Common::getSniffCode($nextStack['class']); + } else { + $sniffCode = substr(strrchr(str_replace('\\', '/', $sniffStack['file']), '/'), 1); + } + + $error .= sprintf(PHP_EOL.'The error originated in the %s sniff on line %s.', $sniffCode, $sniffStack['line']); + } + $file->addErrorOnLine($error, 1, 'Internal.Exception'); }//end try diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php index efe9969d..45e10918 100644 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Sniffs; diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php index 66bc2f52..d4135be0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Sniffs; @@ -250,7 +250,7 @@ final public function process(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the tokens stack where * the listening token type was found. * - * @return array + * @return array|false */ protected function processPattern($patternInfo, File $phpcsFile, $stackPtr) { @@ -850,7 +850,7 @@ private function parse($pattern) * Creates a skip pattern. * * @param string $pattern The pattern being parsed. - * @param string $from The token content that the skip pattern starts from. + * @param int $from The token position that the skip pattern starts from. * * @return array The pattern step. * @see createTokenPattern() diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php index 70d8720a..ce38ba0c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php @@ -21,7 +21,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Sniffs; @@ -42,7 +42,7 @@ abstract class AbstractScopeSniff implements Sniff /** * The type of scope opener tokens that this test wishes to listen to. * - * @var string + * @var array */ private $scopeTokens = []; @@ -148,8 +148,6 @@ final public function process(File $phpcsFile, $stackPtr) return min($skipTokens); } - return; - }//end process() diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php index 5dc8ba55..6493d570 100644 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php @@ -10,7 +10,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Sniffs; diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php index 3f0fb6a1..92acbc4a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php @@ -9,7 +9,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Sniffs; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php index adb74ec8..87da8f3c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; @@ -76,9 +76,15 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array // check indent levels because it's not valid. But we don't enforce exactly // how far indented it should be. if ($startIndent < $baseIndent) { - $error = 'Array open brace not indented correctly; expected at least %s spaces but found %s'; + $pluralizeSpace = 's'; + if ($baseIndent === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array open brace not indented correctly; expected at least %s space%s but found %s'; $data = [ $baseIndent, + $pluralizeSpace, $startIndent, ]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenBraceIncorrect', $data); @@ -117,9 +123,15 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array continue; } - $error = 'Array key not indented correctly; expected %s spaces but found %s'; + $pluralizeSpace = 's'; + if ($expectedIndent === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array key not indented correctly; expected %s space%s but found %s'; $data = [ $expectedIndent, + $pluralizeSpace, $foundIndent, ]; $fix = $phpcsFile->addFixableError($error, $first, 'KeyIncorrect', $data); @@ -154,9 +166,15 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array return; } - $error = 'Array close brace not indented correctly; expected %s spaces but found %s'; + $pluralizeSpace = 's'; + if ($expectedIndent === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array close brace not indented correctly; expected %s space%s but found %s'; $data = [ $expectedIndent, + $pluralizeSpace, $foundIndent, ]; $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceIncorrect', $data); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php index bf7f3ed1..5c838952 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php index 2ba42d67..f9827711 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; @@ -19,7 +19,7 @@ class DisallowShortArraySyntaxSniff implements Sniff /** * Registers the tokens that this sniff wants to listen for. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php index 3243f8b7..c14e7eca 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php index dfd925f9..a00443b3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php index 8788a912..cfde25f5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php @@ -8,7 +8,7 @@ * * @author Juliette Reinders Folmer * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php index 1c9e4000..450df7a2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php @@ -7,7 +7,7 @@ * * @author Juliette Reinders Folmer * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php index 574bb0ba..2e5b7da3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php @@ -18,7 +18,7 @@ * @author Manuel Pichler * @author Greg Sherwood * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php index f583e938..5835f6ce 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php @@ -17,7 +17,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php index 62a07b26..bbe02a34 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php @@ -21,7 +21,7 @@ * @author Greg Sherwood * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php index 364658db..dad82740 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php @@ -24,7 +24,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; @@ -100,8 +100,8 @@ public function process(File $phpcsFile, $stackPtr) /** * Get all used variables in the incrementer part of a for statement. * - * @param array(integer=>array) $tokens Array with all code sniffer tokens. - * @param array(string=>mixed) $token Current for loop token + * @param array $tokens Array with all code sniffer tokens. + * @param array $token Current for loop token * * @return string[] List of all found incrementer variables. */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php index cc9958c5..ccf902fd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php @@ -21,7 +21,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; @@ -64,7 +64,7 @@ public function process(File $phpcsFile, $stackPtr) $token = $tokens[$stackPtr]; // Skip if statement without body. - if (isset($token['parenthesis_opener']) === false) { + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { return; } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php index bed67c93..d66abc27 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php @@ -17,14 +17,13 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; class UnnecessaryFinalModifierSniff implements Sniff { @@ -56,16 +55,13 @@ public function process(File $phpcsFile, $stackPtr) $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; - // Skip for-statements without body. + // Skip for statements without body. if (isset($token['scope_opener']) === false) { return; } - // Fetch previous token. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - // Skip for non final class. - if ($prev === false || $tokens[$prev]['code'] !== T_FINAL) { + if ($phpcsFile->getClassProperties($stackPtr)['is_final'] === false) { + // This class is not final so we don't need to check it. return; } @@ -77,6 +73,13 @@ public function process(File $phpcsFile, $stackPtr) $error = 'Unnecessary FINAL modifier in FINAL class'; $phpcsFile->addWarning($error, $next, 'Found'); } + + // Skip over the contents of functions as those can't contain the `final` keyword anyway. + if ($tokens[$next]['code'] === T_FUNCTION + && isset($tokens[$next]['scope_closer']) === true + ) { + $next = $tokens[$next]['scope_closer']; + } } }//end process() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php index 58aa29fe..70247c26 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php @@ -11,7 +11,7 @@ * @author Manuel Pichler * @author Greg Sherwood * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; @@ -30,6 +30,32 @@ class UnusedFunctionParameterSniff implements Sniff */ public $ignoreTypeHints = []; + /** + * A list of all PHP magic methods with fixed method signatures. + * + * Note: `__construct()` and `__invoke()` are excluded on purpose + * as their method signature is not fixed. + * + * @var array + */ + private $magicMethods = [ + '__destruct' => true, + '__call' => true, + '__callstatic' => true, + '__get' => true, + '__set' => true, + '__isset' => true, + '__unset' => true, + '__sleep' => true, + '__wakeup' => true, + '__serialize' => true, + '__unserialize' => true, + '__tostring' => true, + '__set_state' => true, + '__clone' => true, + '__debuginfo' => true, + ]; + /** * Returns an array of tokens this test wants to listen for. @@ -69,16 +95,29 @@ public function process(File $phpcsFile, $stackPtr) $errorCode = 'Found'; $implements = false; $extends = false; - $classPtr = $phpcsFile->getCondition($stackPtr, T_CLASS); - if ($classPtr !== false) { - $implements = $phpcsFile->findImplementedInterfaceNames($classPtr); - $extends = $phpcsFile->findExtendedClassName($classPtr); - if ($extends !== false) { - $errorCode .= 'InExtendedClass'; - } else if ($implements !== false) { - $errorCode .= 'InImplementedInterface'; + + if ($token['code'] === T_FUNCTION) { + $classPtr = $phpcsFile->getCondition($stackPtr, T_CLASS); + if ($classPtr !== false) { + // Check for magic methods and ignore these as the method signature cannot be changed. + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if (empty($methodName) === false) { + $methodNameLc = strtolower($methodName); + if (isset($this->magicMethods[$methodNameLc]) === true) { + return; + } + } + + // Check for extends/implements and adjust the error code when found. + $implements = $phpcsFile->findImplementedInterfaceNames($classPtr); + $extends = $phpcsFile->findExtendedClassName($classPtr); + if ($extends !== false) { + $errorCode .= 'InExtendedClass'; + } else if ($implements !== false) { + $errorCode .= 'InImplementedInterface'; + } } - } + }//end if $params = []; $methodParams = $phpcsFile->getMethodParameters($stackPtr); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php index fded9295..ba3553e1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php @@ -16,7 +16,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php index 545319be..62c08cea 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php @@ -4,13 +4,14 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; class DocCommentSniff implements Sniff { @@ -280,9 +281,12 @@ public function process(File $phpcsFile, $stackPtr) } // Check that there was single blank line after the tag block - // but account for a multi-line tag comments. + // but account for multi-line tag comments. + $find = Tokens::$phpcsCommentTokens; + $find[T_DOC_COMMENT_TAG] = T_DOC_COMMENT_TAG; + $lastTag = $group[$pos]; - $next = $phpcsFile->findNext(T_DOC_COMMENT_TAG, ($lastTag + 3), $commentEnd); + $next = $phpcsFile->findNext($find, ($lastTag + 3), $commentEnd); if ($next !== false) { $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_TAG, T_DOC_COMMENT_STRING], ($next - 1), $commentStart); if ($tokens[$next]['line'] !== ($tokens[$prev]['line'] + 2)) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php index 84385221..240c60ed 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php @@ -5,7 +5,7 @@ * @author Greg Sherwood * @author Sam Graham * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php index 63968046..9b5b34ab 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php index f760fa1c..7a705747 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php @@ -5,7 +5,7 @@ * @author Mponos George * @author Mark Scherer * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php index a67a6a79..0d2ede5b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; @@ -62,7 +62,7 @@ public function register() * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * - * @return void + * @return void|int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php index 81284787..4fe8bd7c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php @@ -4,7 +4,7 @@ * * @author Roman Levishchenko * @copyright 2013-2014 Roman Levishchenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; @@ -44,13 +44,13 @@ public function register() * @param int $stackPtr The position in the stack where * the token was found. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { $csslintPath = Config::getExecutablePath('csslint'); if ($csslintPath === null) { - return; + return ($phpcsFile->numTokens + 1); } $fileName = $phpcsFile->getFilename(); @@ -59,7 +59,7 @@ public function process(File $phpcsFile, $stackPtr) exec($cmd, $output, $retval); if (is_array($output) === false) { - return; + return ($phpcsFile->numTokens + 1); } $count = count($output); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php index 19204718..6bcc0a75 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; @@ -22,14 +22,14 @@ class ClosureLinterSniff implements Sniff * * All other error codes will show warnings. * - * @var integer + * @var array */ public $errorCodes = []; /** * A list of error codes to ignore. * - * @var integer + * @var array */ public $ignoreCodes = []; @@ -60,14 +60,14 @@ public function register() * @param int $stackPtr The position in the stack where * the token was found. * - * @return void + * @return int * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run */ public function process(File $phpcsFile, $stackPtr) { $lintPath = Config::getExecutablePath('gjslint'); if ($lintPath === null) { - return; + return ($phpcsFile->numTokens + 1); } $fileName = $phpcsFile->getFilename(); @@ -77,7 +77,7 @@ public function process(File $phpcsFile, $stackPtr) exec($cmd, $output, $retval); if (is_array($output) === false) { - return; + return ($phpcsFile->numTokens + 1); } foreach ($output as $finding) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php index d11d3470..8145dc70 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php @@ -4,7 +4,7 @@ * * @author Ryan McCue * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; @@ -51,14 +51,14 @@ public function register() * @param int $stackPtr The position in the stack where * the token was found. * - * @return void + * @return int * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run */ public function process(File $phpcsFile, $stackPtr) { $eslintPath = Config::getExecutablePath('eslint'); if ($eslintPath === null) { - return; + return ($phpcsFile->numTokens + 1); } $filename = $phpcsFile->getFilename(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php index 06de3594..a8f6e2d2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php @@ -5,7 +5,7 @@ * @author Greg Sherwood * @author Alexander Wei§ * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; @@ -45,15 +45,15 @@ public function register() * @param int $stackPtr The position in the stack where * the token was found. * - * @return void + * @return int * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run */ public function process(File $phpcsFile, $stackPtr) { $rhinoPath = Config::getExecutablePath('rhino'); $jshintPath = Config::getExecutablePath('jshint'); - if ($rhinoPath === null && $jshintPath === null) { - return; + if ($jshintPath === null) { + return ($phpcsFile->numTokens + 1); } $fileName = $phpcsFile->getFilename(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php index cee8ecc5..23249156 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php @@ -5,7 +5,7 @@ * @author Piotr Karas * @author Greg Sherwood * @copyright 2010-2014 mediaSELF Sp. z o.o. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php index d5375dc5..ffca4227 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php index 41c9c749..2e82176b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php index e1213d5f..7db30618 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php @@ -4,7 +4,7 @@ * * @author Matthew Peveler * @copyright 2019 Matthew Peveler - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php index eb01da87..af546434 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; @@ -48,7 +48,7 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return int|null + * @return int|void */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php index 845e1bcf..1d17ada4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; @@ -79,7 +79,7 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$lastToken]['line'] === 1 && $tokens[$lastToken]['content'] !== "\n" ) { - return; + return ($phpcsFile->numTokens + 1); } } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php index 5aa45ea0..56fbe858 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php @@ -8,7 +8,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php index a9fd4c5d..90af44f6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; @@ -44,7 +44,7 @@ public function process(File $phpcsFile, $stackPtr) { $filename = $phpcsFile->getFilename(); if ($filename === 'STDIN') { - return; + return ($phpcsFile->numTokens + 1); } $filename = basename($filename); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php index 52d5d84c..9eea7278 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php index 9a6f5bcc..71b6894a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php index 4d417e06..d94a32db 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php @@ -4,7 +4,7 @@ * * @author Mponos George * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php index 7ae523f7..0be37341 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php @@ -4,7 +4,7 @@ * * @author Alexander Obuhovich * @copyright 2010-2014 Alexander Obuhovich - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php index 6f9ff9f9..5466938d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php index 802e5944..68ddf53f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php index f6a37daf..e7d294de 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * * @deprecated 3.4.0 Use the Generic.Formatting.SpaceAfterCast sniff with * the $spacing property set to 0 instead. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php index f19489e8..0ab8d3d5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; @@ -54,8 +54,12 @@ public function register() */ public function process(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); - $this->spacing = (int) $this->spacing; + $tokens = $phpcsFile->getTokens(); + $this->spacing = (int) $this->spacing; + $pluralizeSpace = 's'; + if ($this->spacing === 1) { + $pluralizeSpace = ''; + } if ($tokens[$stackPtr]['code'] === T_BINARY_CAST && $tokens[$stackPtr]['content'] === 'b' @@ -83,8 +87,11 @@ public function process(File $phpcsFile, $stackPtr) $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); if ($nextNonEmpty !== $nextNonWhitespace) { - $error = 'Expected %s space(s) after cast statement; comment found'; - $data = [$this->spacing]; + $error = 'Expected %s space%s after cast statement; comment found'; + $data = [ + $this->spacing, + $pluralizeSpace, + ]; $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { @@ -109,9 +116,10 @@ public function process(File $phpcsFile, $stackPtr) return; } - $error = 'Expected %s space(s) after cast statement; %s found'; + $error = 'Expected %s space%s after cast statement; %s found'; $data = [ $this->spacing, + $pluralizeSpace, $found, ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php index b74ca80e..99e267d6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; @@ -64,8 +64,12 @@ public function register() */ public function process(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); - $this->spacing = (int) $this->spacing; + $tokens = $phpcsFile->getTokens(); + $this->spacing = (int) $this->spacing; + $pluralizeSpace = 's'; + if ($this->spacing === 1) { + $pluralizeSpace = ''; + } $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($nextNonEmpty === false) { @@ -84,8 +88,11 @@ public function process(File $phpcsFile, $stackPtr) $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); if ($nextNonEmpty !== $nextNonWhitespace) { - $error = 'Expected %s space(s) after NOT operator; comment found'; - $data = [$this->spacing]; + $error = 'Expected %s space%s after NOT operator; comment found'; + $data = [ + $this->spacing, + $pluralizeSpace, + ]; $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); return; } @@ -101,9 +108,10 @@ public function process(File $phpcsFile, $stackPtr) return; } - $error = 'Expected %s space(s) after NOT operator; %s found'; + $error = 'Expected %s space%s after NOT operator; %s found'; $data = [ $this->spacing, + $pluralizeSpace, $found, ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php index a4f85aeb..e4d93384 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php index 425748ce..33f0c34e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php @@ -4,7 +4,7 @@ * * @author Florian Grandel * @copyright 2009-2014 Florian Grandel - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php index 136a1d4a..2b33eeac 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; @@ -156,10 +156,13 @@ public function checkSpacing(File $phpcsFile, $stackPtr, $openBracket) }//end if if ($tokens[($nextSeparator + 1)]['code'] !== T_WHITESPACE) { - $error = 'No space found after comma in argument list'; - $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'NoSpaceAfterComma'); - if ($fix === true) { - $phpcsFile->fixer->addContent($nextSeparator, ' '); + // Ignore trailing comma's after last argument as that's outside the scope of this sniff. + if (($nextSeparator + 1) !== $closeBracket) { + $error = 'No space found after comma in argument list'; + $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'NoSpaceAfterComma'); + if ($fix === true) { + $phpcsFile->fixer->addContent($nextSeparator, ' '); + } } } else { // If there is a newline in the space, then they must be formatting diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php index ff19526a..d60ab61e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; @@ -170,15 +170,13 @@ public function process(File $phpcsFile, $stackPtr) $ignore[] = T_WHITESPACE; $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - if ($next === $tokens[$stackPtr]['scope_closer']) { - // Ignore empty functions. - return; - } - - $error = 'Opening brace must be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'ContentAfterBrace'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($openingBrace); + // Only throw this error when this is not an empty function. + if ($next !== $tokens[$stackPtr]['scope_closer']) { + $error = 'Opening brace must be the last content on the line'; + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'ContentAfterBrace'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($openingBrace); + } } } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php index 62eafc12..ca259854 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; @@ -34,7 +34,7 @@ class OpeningFunctionBraceKernighanRitchieSniff implements Sniff /** * Registers the tokens that this sniff wants to listen for. * - * @return void + * @return array */ public function register() { @@ -130,17 +130,15 @@ public function process(File $phpcsFile, $stackPtr) $ignore[] = T_WHITESPACE; $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - if ($next === $tokens[$stackPtr]['scope_closer'] - || $tokens[$next]['code'] === T_CLOSE_TAG + // Only throw this error when this is not an empty function. + if ($next !== $tokens[$stackPtr]['scope_closer'] + && $tokens[$next]['code'] !== T_CLOSE_TAG ) { - // Ignore empty functions. - return; - } - - $error = 'Opening brace must be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'ContentAfterBrace'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($openingBrace); + $error = 'Opening brace must be the last content on the line'; + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'ContentAfterBrace'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($openingBrace); + } } } @@ -168,7 +166,7 @@ public function process(File $phpcsFile, $stackPtr) if ($length !== 1) { $error = 'Expected 1 space before opening brace; found %s'; $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpaceBeforeBrace', $data); + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'SpaceBeforeBrace', $data); if ($fix === true) { if ($length === 0 || $length === '\t') { $phpcsFile->fixer->addContentBefore($openingBrace, ' '); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php index 9bd0dff3..f68666f9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php @@ -9,7 +9,7 @@ * @author Johann-Peter Hartmann * @author Greg Sherwood * @copyright 2007-2014 Mayflower GmbH - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php index d001deda..35b5b29a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php @@ -5,7 +5,7 @@ * @author Johann-Peter Hartmann * @author Greg Sherwood * @copyright 2007-2014 Mayflower GmbH - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php index 3e3af830..8f3e5570 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php @@ -3,7 +3,7 @@ * Checks that abstract classes are prefixed by Abstract. * * @author Anna Borzenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php index b4511203..ec1cfd00 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php index a4196063..75fbd226 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php @@ -8,7 +8,7 @@ * @author Greg Sherwood * @author Leif Wickland * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php index c5dc34d4..2e69aea5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php @@ -3,7 +3,7 @@ * Checks that interfaces are suffixed by Interface. * * @author Anna Borzenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php index 4e3b211d..81a96b79 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php @@ -3,7 +3,7 @@ * Checks that traits are suffixed by Trait. * * @author Anna Borzenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php index db50eb56..4f4ae40e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php index d455845b..ce9bee31 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php index f52180dd..af9cb9b2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php index d03bf8ab..b8ed0a0a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php @@ -4,7 +4,7 @@ * * @author Stefano Kowalke * @copyright 2010-2014 Stefano Kowalke - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php index 42eaa40f..83f38898 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php @@ -5,7 +5,7 @@ * @author Sebastian Bergmann * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php index 433750ad..e3e852dd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php @@ -6,7 +6,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; @@ -28,7 +28,7 @@ class DisallowAlternativePHPTagsSniff implements Sniff /** * The current PHP version. * - * @var integer + * @var integer|string|null */ private $phpVersion = null; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperglobalSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperglobalSniff.php index 1c2b1aee..913e16f9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperglobalSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperglobalSniff.php @@ -4,7 +4,7 @@ * * @author Jeantwan Teuma * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php index 3f3fdbe6..b7dc75ce 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; @@ -46,7 +46,7 @@ public function register() * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * - * @return void + * @return void|int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DiscourageGotoSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DiscourageGotoSniff.php index 6389846d..1a552ee7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DiscourageGotoSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DiscourageGotoSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php index 1a10b153..9b21db15 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; @@ -163,6 +163,11 @@ public function process(File $phpcsFile, $stackPtr) return; } + if (empty($tokens[$stackPtr]['nested_attributes']) === false) { + // Class instantiation in attribute, not function call. + return; + } + $function = strtolower($tokens[$stackPtr]['content']); $pattern = null; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php index 4376daa9..f2e3629d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; @@ -37,6 +37,29 @@ class LowerCaseConstantSniff implements Sniff T_NULL => T_NULL, ]; + /** + * Token types which can be encountered in a property type declaration. + * + * @var array + */ + private $propertyTypeTokens = [ + T_CALLABLE => T_CALLABLE, + T_SELF => T_SELF, + T_PARENT => T_PARENT, + T_FALSE => T_FALSE, + T_TRUE => T_TRUE, + T_NULL => T_NULL, + T_STRING => T_STRING, + T_NAME_QUALIFIED => T_NAME_QUALIFIED, + T_NAME_FULLY_QUALIFIED => T_NAME_FULLY_QUALIFIED, + T_NAME_RELATIVE => T_NAME_RELATIVE, + T_NS_SEPARATOR => T_NS_SEPARATOR, + T_NAMESPACE => T_NAMESPACE, + T_TYPE_UNION => T_TYPE_UNION, + T_TYPE_INTERSECTION => T_TYPE_INTERSECTION, + T_NULLABLE => T_NULLABLE, + ]; + /** * Returns an array of tokens this test wants to listen for. @@ -47,7 +70,13 @@ public function register() { $targets = $this->targets; - // Register function keywords to filter out type declarations. + // Register scope modifiers to filter out property type declarations. + $targets += Tokens::$scopeModifiers; + $targets[] = T_VAR; + $targets[] = T_STATIC; + $targets[] = T_READONLY; + + // Register function keywords to filter out param/return type declarations. $targets[] = T_FUNCTION; $targets[] = T_CLOSURE; $targets[] = T_FN; @@ -64,12 +93,43 @@ public function register() * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * - * @return void + * @return void|int Optionally returns a stack pointer. The sniff will not be + * called again on the current file until the returned stack + * pointer is reached. */ public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); + /* + * Skip over type declarations for properties. + * + * Note: for other uses of the visibility modifiers (functions, constants, trait use), + * nothing relevant will be skipped as the next non-empty token will be an "non-skippable" + * one. + * Functions are handled separately below (and then skip to their scope opener), so + * this should also not cause any confusion for constructor property promotion. + * + * For other uses of the "static" keyword, it also shouldn't be problematic as the only + * time the next non-empty token will be a "skippable" token will be in return type + * declarations, in which case, it is correct to skip over them. + */ + + if (isset(Tokens::$scopeModifiers[$tokens[$stackPtr]['code']]) === true + || $tokens[$stackPtr]['code'] === T_VAR + || $tokens[$stackPtr]['code'] === T_STATIC + || $tokens[$stackPtr]['code'] === T_READONLY + ) { + $skipOver = (Tokens::$emptyTokens + $this->propertyTypeTokens); + $skipTo = $phpcsFile->findNext($skipOver, ($stackPtr + 1), null, true); + if ($skipTo !== false) { + return $skipTo; + } + + // If we're at the end of the file, just return. + return; + } + // Handle function declarations separately as they may contain the keywords in type declarations. if ($tokens[$stackPtr]['code'] === T_FUNCTION || $tokens[$stackPtr]['code'] === T_CLOSURE @@ -79,9 +139,15 @@ public function process(File $phpcsFile, $stackPtr) return; } + // Make sure to skip over return type declarations. $end = $tokens[$stackPtr]['parenthesis_closer']; if (isset($tokens[$stackPtr]['scope_opener']) === true) { $end = $tokens[$stackPtr]['scope_opener']; + } else { + $skipTo = $phpcsFile->findNext([T_SEMICOLON, T_OPEN_CURLY_BRACKET], ($end + 1), null, false, null, true); + if ($skipTo !== false) { + $end = $skipTo; + } } // Do a quick check if any of the targets exist in the declaration. @@ -114,21 +180,6 @@ public function process(File $phpcsFile, $stackPtr) return $end; }//end if - // Handle property declarations separately as they may contain the keywords in type declarations. - if (isset($tokens[$stackPtr]['conditions']) === true) { - $conditions = $tokens[$stackPtr]['conditions']; - $lastCondition = end($conditions); - if (isset(Tokens::$ooScopeTokens[$lastCondition]) === true) { - // This can only be an OO constant or property declaration as methods are handled above. - $equals = $phpcsFile->findPrevious(T_EQUAL, ($stackPtr - 1), null, false, null, true); - if ($equals !== false) { - $this->processConstant($phpcsFile, $stackPtr); - } - - return; - } - } - // Handle everything else. $this->processConstant($phpcsFile, $stackPtr); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php index e6b49178..542fea5d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php index 4d463f28..f309960d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; @@ -37,6 +37,7 @@ class LowerCaseTypeSniff implements Sniff 'mixed' => true, 'static' => true, 'false' => true, + 'true' => true, 'null' => true, 'never' => true, ]; @@ -50,10 +51,10 @@ class LowerCaseTypeSniff implements Sniff public function register() { $tokens = Tokens::$castTokens; + $tokens += Tokens::$ooScopeTokens; $tokens[] = T_FUNCTION; $tokens[] = T_CLOSURE; $tokens[] = T_FN; - $tokens[] = T_VARIABLE; return $tokens; }//end register() @@ -89,35 +90,66 @@ public function process(File $phpcsFile, $stackPtr) * Check property types. */ - if ($tokens[$stackPtr]['code'] === T_VARIABLE) { - try { - $props = $phpcsFile->getMemberProperties($stackPtr); - } catch (RuntimeException $e) { - // Not an OO property. + if (isset(Tokens::$ooScopeTokens[$tokens[$stackPtr]['code']]) === true) { + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { return; } - // Strip off potential nullable indication. - $type = ltrim($props['type'], '?'); + for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $tokens[$stackPtr]['scope_closer']; $i++) { + // Skip over potentially large docblocks. + if ($tokens[$i]['code'] === \T_DOC_COMMENT_OPEN_TAG + && isset($tokens[$i]['comment_closer']) === true + ) { + $i = $tokens[$i]['comment_closer']; + continue; + } - if ($type !== '') { - $error = 'PHP property type declarations must be lowercase; expected "%s" but found "%s"'; - $errorCode = 'PropertyTypeFound'; + // Skip over function declarations and everything nested within. + if ($tokens[$i]['code'] === \T_FUNCTION + && isset($tokens[$i]['scope_closer']) === true + ) { + $i = $tokens[$i]['scope_closer']; + continue; + } - if ($props['type_token'] === T_TYPE_INTERSECTION) { - // Intersection types don't support simple types. - } else if (strpos($type, '|') !== false) { - $this->processUnionType( - $phpcsFile, - $props['type_token'], - $props['type_end_token'], - $error, - $errorCode - ); - } else if (isset($this->phpTypes[strtolower($type)]) === true) { - $this->processType($phpcsFile, $props['type_token'], $type, $error, $errorCode); + if ($tokens[$i]['code'] !== \T_VARIABLE) { + continue; } - } + + try { + $props = $phpcsFile->getMemberProperties($i); + } catch (RuntimeException $e) { + // Not an OO property. + continue; + } + + if (empty($props) === true) { + // Parse error - property in interface or enum. Ignore. + return; + } + + // Strip off potential nullable indication. + $type = ltrim($props['type'], '?'); + + if ($type !== '') { + $error = 'PHP property type declarations must be lowercase; expected "%s" but found "%s"'; + $errorCode = 'PropertyTypeFound'; + + if ($props['type_token'] === T_TYPE_INTERSECTION) { + // Intersection types don't support simple types. + } else if (strpos($type, '|') !== false) { + $this->processUnionType( + $phpcsFile, + $props['type_token'], + $props['type_end_token'], + $error, + $errorCode + ); + } else if (isset($this->phpTypes[strtolower($type)]) === true) { + $this->processType($phpcsFile, $props['type_token'], $type, $error, $errorCode); + } + } + }//end for return; }//end if diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php index 14dfaa72..a3db4a16 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php @@ -11,7 +11,7 @@ * * @author Andy Brockhurst * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/RequireStrictTypesSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/RequireStrictTypesSniff.php index bffe7439..1e0dc9de 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/RequireStrictTypesSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/RequireStrictTypesSniff.php @@ -4,13 +4,14 @@ * * @author Sertan Danis * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; class RequireStrictTypesSniff implements Sniff { @@ -40,23 +41,61 @@ public function register() public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - $declare = $phpcsFile->findNext(T_DECLARE, $stackPtr); - $found = false; + $declare = $phpcsFile->findNext(T_DECLARE, ($stackPtr + 1)); + + $found = false; if ($declare !== false) { - $nextString = $phpcsFile->findNext(T_STRING, $declare); + if (isset($tokens[$declare]['parenthesis_opener'], $tokens[$declare]['parenthesis_closer']) === false) { + // Live coding, ignore for now. + return $phpcsFile->numTokens; + } + + $next = $tokens[$declare]['parenthesis_opener']; + + do { + $next = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($next + 1), + $tokens[$declare]['parenthesis_closer'], + true + ); - if ($nextString !== false) { - if (strtolower($tokens[$nextString]['content']) === 'strict_types') { + if ($next !== false + && $tokens[$next]['code'] === T_STRING + && strtolower($tokens[$next]['content']) === 'strict_types' + ) { // There is a strict types declaration. $found = true; + break; } - } - } + + $next = $phpcsFile->findNext(T_COMMA, ($next + 1), $tokens[$declare]['parenthesis_closer']); + } while ($next !== false && $next < $tokens[$declare]['parenthesis_closer']); + }//end if if ($found === false) { $error = 'Missing required strict_types declaration'; $phpcsFile->addError($error, $stackPtr, 'MissingDeclaration'); + + return $phpcsFile->numTokens; + } + + // Strict types declaration found, make sure strict types is enabled. + $skip = Tokens::$emptyTokens; + $skip[] = T_EQUAL; + $valuePtr = $phpcsFile->findNext($skip, ($next + 1), null, true); + + if ($valuePtr !== false + && $tokens[$valuePtr]['code'] === T_LNUMBER + && $tokens[$valuePtr]['content'] === '0' + ) { + $error = 'Required strict_types declaration found, but strict types is disabled. Set the value to 1 to enable'; + $fix = $phpcsFile->addFixableWarning($error, $valuePtr, 'Disabled'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken($valuePtr, '1'); + } } // Skip the rest of the file so we don't pick up additional diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php index 19d58572..05bac452 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php index 85e717bc..ffc1ff6d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php @@ -5,7 +5,7 @@ * @author Greg Sherwood * @author Blaine Schmeisser * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; @@ -48,7 +48,7 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php index 2740884b..1a65f3c3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php index 82dae8fb..2d2286c9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php index 83265b2e..03028cb7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl; @@ -49,7 +49,7 @@ public function register() * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php index 3c3829a6..a1558583 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php @@ -4,7 +4,7 @@ * * @author Jack Bates * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl; @@ -50,7 +50,7 @@ public function register() * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { @@ -113,7 +113,7 @@ public function process(File $phpcsFile, $stackPtr) * * @param string $path The path to return Subversion properties on. * - * @return array + * @return array|null * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If Subversion properties file could * not be opened. */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php index 09aea543..4d223ee1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php @@ -7,7 +7,7 @@ * * @author Juliette Reinders Folmer * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace; @@ -78,7 +78,7 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return void|int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php index bbdbfe0a..b2290cd1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace; @@ -56,7 +56,7 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php index 2140e55e..471bb3d0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace; @@ -56,7 +56,7 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php index 0ff30f44..95ba3d82 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2018 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace; @@ -63,7 +63,8 @@ public function process(File $phpcsFile, $stackPtr) // Is this a pre-increment/decrement ? $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($nextNonEmpty !== false - && (($phpcsFile->tokenizerType === 'PHP' && $tokens[$nextNonEmpty]['code'] === T_VARIABLE) + && (($phpcsFile->tokenizerType === 'PHP' + && ($tokens[$nextNonEmpty]['code'] === T_VARIABLE || $tokens[$nextNonEmpty]['code'] === T_STRING)) || ($phpcsFile->tokenizerType === 'JS' && $tokens[$nextNonEmpty]['code'] === T_STRING)) ) { if ($nextNonEmpty === ($stackPtr + 1)) { @@ -116,7 +117,10 @@ public function process(File $phpcsFile, $stackPtr) // Is this a post-increment/decrement ? $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); if ($prevNonEmpty !== false - && (($phpcsFile->tokenizerType === 'PHP' && $tokens[$prevNonEmpty]['code'] === T_VARIABLE) + && (($phpcsFile->tokenizerType === 'PHP' + && ($tokens[$prevNonEmpty]['code'] === T_VARIABLE + || $tokens[$prevNonEmpty]['code'] === T_STRING + || $tokens[$prevNonEmpty]['code'] === T_CLOSE_SQUARE_BRACKET)) || ($phpcsFile->tokenizerType === 'JS' && $tokens[$prevNonEmpty]['code'] === T_STRING)) ) { if ($prevNonEmpty === ($stackPtr - 1)) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php index 068a4e7f..c577c9dc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php index 7fd60484..2453abdc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace; @@ -80,7 +80,7 @@ class ScopeIndentSniff implements Sniff * This is a cached copy of the public version of this var, which * can be set in a ruleset file, and some core ignored tokens. * - * @var int[] + * @var array */ private $ignoreIndentation = []; @@ -1090,8 +1090,11 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$i]['code'] === T_CONSTANT_ENCAPSED_STRING || $tokens[$i]['code'] === T_DOUBLE_QUOTED_STRING ) { - $i = $phpcsFile->findNext($tokens[$i]['code'], ($i + 1), null, true); - $i--; + $nextNonTextString = $phpcsFile->findNext($tokens[$i]['code'], ($i + 1), null, true); + if ($nextNonTextString !== false) { + $i = ($nextNonTextString - 1); + } + continue; } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php index 070bbcd1..44a05036 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace; @@ -54,8 +54,12 @@ public function register() */ public function process(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); - $this->spacing = (int) $this->spacing; + $tokens = $phpcsFile->getTokens(); + $this->spacing = (int) $this->spacing; + $pluralizeSpace = 's'; + if ($this->spacing === 1) { + $pluralizeSpace = ''; + } $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($nextNonEmpty === false) { @@ -81,8 +85,11 @@ public function process(File $phpcsFile, $stackPtr) $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); if ($nextNonEmpty !== $nextNonWhitespace) { - $error = 'Expected %s space(s) after the spread operator; comment found'; - $data = [$this->spacing]; + $error = 'Expected %s space%s after the spread operator; comment found'; + $data = [ + $this->spacing, + $pluralizeSpace, + ]; $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { @@ -107,9 +114,10 @@ public function process(File $phpcsFile, $stackPtr) return; } - $error = 'Expected %s space(s) after the spread operator; %s found'; + $error = 'Expected %s space%s after the spread operator; %s found'; $data = [ $this->spacing, + $pluralizeSpace, $found, ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc index 075fc34c..6f418ca1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc @@ -111,3 +111,41 @@ $array = [ name: $value ), ]; + +// phpcs:set Generic.Arrays.ArrayIndent indent 1 + +// Testing pluralization of indent text - open brace indent. + $var = +[ + 1 => 'one', +]; + +// Testing pluralization of indent text - array item indent. +$var = [ + 1 => 'one', + 2 => 'two', + /* three */ 3 => 'three', +]; + +// Testing pluralization of indent text - close brace indent. + $var = [ + 1 => 'one', + ]; + +// phpcs:set Generic.Arrays.ArrayIndent indent 0 + +// No test for open brace indent as that is _minimum_ and any actual value will be 0 or more, so with indent 0, this will never yield an error. + +// Testing pluralization of indent text - array item indent. +$var = [ + 1 => 'one', + 2 => 'two', + /* three */ 3 => 'three', +]; + +// Testing pluralization of indent text - close brace indent. +$var = [ +1 => 'one', + ]; + +// phpcs:set Generic.Arrays.ArrayIndent indent 4 diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed index 505de5f7..1ea8dd1e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed @@ -112,3 +112,41 @@ $array = [ name: $value ), ]; + +// phpcs:set Generic.Arrays.ArrayIndent indent 1 + +// Testing pluralization of indent text - open brace indent. + $var = + [ + 1 => 'one', + ]; + +// Testing pluralization of indent text - array item indent. +$var = [ + 1 => 'one', + 2 => 'two', + /* three */ 3 => 'three', +]; + +// Testing pluralization of indent text - close brace indent. + $var = [ + 1 => 'one', + ]; + +// phpcs:set Generic.Arrays.ArrayIndent indent 0 + +// No test for open brace indent as that is _minimum_ and any actual value will be 0 or more, so with indent 0, this will never yield an error. + +// Testing pluralization of indent text - array item indent. +$var = [ +1 => 'one', +2 => 'two', +/* three */ 3 => 'three', +]; + +// Testing pluralization of indent text - close brace indent. +$var = [ +1 => 'one', +]; + +// phpcs:set Generic.Arrays.ArrayIndent indent 4 diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php index 4861041f..e1c83467 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Arrays; @@ -45,6 +45,14 @@ public function getErrorList() 88 => 1, 98 => 1, 110 => 1, + 119 => 1, + 126 => 1, + 127 => 1, + 133 => 1, + 141 => 1, + 142 => 1, + 143 => 1, + 149 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.php index af1d9c9a..edd7e6d5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Arrays; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.php index 25c9666e..d9d305db 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Arrays; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php index 68982f86..25685d10 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Classes; @@ -50,7 +50,7 @@ public function getWarningList($testFile='') 12 => 1, 13 => 1, ]; - break; + case 'DuplicateClassNameUnitTest.2.inc': return [ 2 => 1, @@ -58,19 +58,18 @@ public function getWarningList($testFile='') 4 => 1, 5 => 1, ]; - break; + case 'DuplicateClassNameUnitTest.5.inc': return [ 3 => 1, 7 => 1, ]; - break; + case 'DuplicateClassNameUnitTest.6.inc': return [10 => 1]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.php index c357afc9..1fa1e4d2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php index 3ed57d22..889b7010 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.php index 23b3ec8f..e83dff0a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.php index 4e00ada1..464ea504 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.php index 1d9eddaa..b474c086 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.php index 60f00b5d..c2d45eea 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.php index d6f0e3d4..376df0c6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.inc index 1d980ae2..0d220c96 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.inc @@ -10,4 +10,8 @@ if (true) { if (file_exists(__FILE__) === true) { -} \ No newline at end of file +} + +// Intentional parse error/live coding. +// This needs to be the last test in the file. +if(true diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.php index a99fdd8d..8f373d92 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.inc index 0ba5df77..026cf484 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.inc @@ -27,3 +27,8 @@ final class Bar_Foo { protected function foo() {} private function Bar() {} } + +final readonly class Foo_Bar { + public final function fooBar() {} + final protected function fool() {} +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.php index 732f3031..5f65d6e3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; @@ -45,6 +45,8 @@ public function getWarningList() 12 => 1, 15 => 1, 18 => 1, + 32 => 1, + 33 => 1, ]; }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.inc index d800d690..154f0315 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.inc @@ -44,13 +44,13 @@ HERE; $x = $parameter; // This line must be immediately after the HERE; with no intervening blank lines. $tango = << $array[2] === $needle); + + +/* + * Don't adjust the error code for closures and arrow functions in extended classes/classes implementing interfaces. + */ +class MyExtendedClass extends SomeClass { + public function something($a, $b) { + $c = $a + $b; + $closure = function ($c, $d) { + return $c * 2; + }; + } +} + +class MyExtendedClass implements SomeInterface { + public function something($a, $b) { + $c = $a + $b; + $fn = fn($c, $d) => $c[2]; + } +} + + +/** + * Magic methods must match the function signature dictated by PHP. + * Flagging unused parameters leads to notices which cannot be solved. + */ +class MagicMethodsWithParams { + public function __set(string $name, mixed $value) { + // Forbid dynamic properties & overloading inaccessible properties. + throw new RuntimeException('Forbidden'); + } + + public function __get(string $name) { + throw new RuntimeException('Forbidden'); + } + + public function __isset(string $name) { + throw new RuntimeException('Forbidden'); + } + + public function __unset(string $name) { + throw new RuntimeException('Forbidden'); + } + + public function __unserialize( array $data ) { + // Prevent unserializing from a stored representation of the object for security reasons. + $this->instance = new self(); + } + + public static function __set_state(array $properties) { + return new self(); + } + + public function __call(string $name, array $arguments) { + if (method_exists($this, $name)) { + // None of the methods which can be called in this class take arguments, so not passing them. + return $this->$name(); + } + } + + public static function __callStatic(string $name, array $arguments) { + if (method_exists($this, $name)) { + // None of the methods which can be called in this class take arguments, so not passing them. + return self::$name(); + } + } +} + +/** + * Unused parameters in magic methods which have flexible function signatures should still be flagged. + */ +class MagicMethodsWithParamsNotDictatedByPHP { + public $foo; + public function __construct($foo, $bar, $baz) { + $this->foo = $foo; + } + + public function __invoke($foo, $bar, $baz) { + $this->foo = $foo; + } +} + +/** + * Unused parameters in magic methods which have flexible function signatures + * where the method potentially overloads a parent method should still be flagged, + * but should use the `FoundInExtendedClassAfterLastUsed` error code. + */ +class MagicMethodsWithParamsNotDictatedByPHPInChildClass extends SomeParent{ + public $foo; + public function __construct($foo, $bar, $baz) { + $this->foo = $foo; + } + + public function __invoke($foo, $bar, $baz) { + $this->foo = $foo; + } +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.php index 063c7207..2f3aab80 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; @@ -50,6 +50,12 @@ public function getWarningList() 117 => 1, 121 => 2, 125 => 2, + 163 => 1, + 172 => 1, + 228 => 2, + 232 => 2, + 244 => 2, + 248 => 2, ]; }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.php index d6ea1d03..b04b2743 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.php @@ -4,7 +4,7 @@ * * @author Manuel Pichler * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\CodeAnalysis; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc index 81366272..bcd8256d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc @@ -144,7 +144,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -232,7 +232,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -245,8 +245,18 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ +/** + * Do something. + * + * @codeCoverageIgnore + * + * @phpcs:disable Stnd.Cat.SniffName + * + * @return void + */ + /** No docblock close tag. Must be last test without new line. \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc.fixed index 43ce064a..7da1c8ae 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc.fixed @@ -139,7 +139,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -237,7 +237,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -250,8 +250,18 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ +/** + * Do something. + * + * @codeCoverageIgnore + * + * @phpcs:disable Stnd.Cat.SniffName + * + * @return void + */ + /** No docblock close tag. Must be last test without new line. \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js index b3283f78..3506fe0c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js @@ -144,7 +144,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -232,7 +232,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -245,6 +245,6 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js.fixed index 0df0687a..f4ca127d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js.fixed @@ -139,7 +139,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -237,7 +237,7 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -250,6 +250,6 @@ * @author Greg Sherwood * @author Marc McIntyre * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php index 57937581..4f2c18f9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php index e14ab316..49104feb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php @@ -5,7 +5,7 @@ * @author Greg Sherwood * @author Sam Graham * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php index 4864b937..06515953 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.php index c558ae8f..1fd642c8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php index a9c4f4f8..d7e07bb7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php index 2b86facc..9af0d930 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; @@ -19,7 +19,7 @@ class CSSLintUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php index 2d960f32..f5054b5c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; @@ -19,7 +19,7 @@ class ClosureLinterUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php index 0a079d14..d9d754d7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; @@ -36,37 +36,39 @@ class ESLintUnitTest extends AbstractSniffUnitTest /** * Sets up this unit test. * + * @before + * * @return void */ - protected function setUp() + protected function setUpPrerequisites() { - parent::setUp(); + parent::setUpPrerequisites(); $cwd = getcwd(); file_put_contents($cwd.'/.eslintrc.json', self::ESLINT_CONFIG); - }//end setUp() + }//end setUpPrerequisites() /** * Remove artifact. * + * @after + * * @return void */ - protected function tearDown() + protected function resetProperties() { - parent::tearDown(); - $cwd = getcwd(); unlink($cwd.'/.eslintrc.json'); - }//end tearDown() + }//end resetProperties() /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php index 618465a9..e7753d05 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; @@ -19,13 +19,13 @@ class JSHintUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { $rhinoPath = Config::getExecutablePath('rhino'); $jshintPath = Config::getExecutablePath('jshint'); - if ($rhinoPath === null && $jshintPath === null) { + if ($jshintPath === null) { return true; } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php index a95331d7..2e9fc9ef 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.php index f5ab9ffa..ebda19cb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.php index 88dc2f88..1333eb77 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php index 269102dd..c10b34fa 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php @@ -4,7 +4,7 @@ * * @author Matthew Peveler * @copyright 2019 Matthew Peveler - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; @@ -18,14 +18,12 @@ class ExecutableFileUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { - // PEAR doesn't preserve the executable flag, so skip - // tests when running in a PEAR install. - // Also skip on Windows which doesn't have the concept of executable files. - return ($GLOBALS['PHP_CODESNIFFER_PEAR'] || stripos(PHP_OS, 'WIN') === 0); + // Skip on Windows which doesn't have the concept of executable files. + return (stripos(PHP_OS, 'WIN') === 0); }//end shouldSkipTest() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php index 4403e5d5..5619069c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; @@ -30,16 +30,15 @@ public function getErrorList($testFile='') switch ($testFile) { case 'InlineHTMLUnitTest.3.inc': return [4 => 1]; - break; + case 'InlineHTMLUnitTest.4.inc': return [1 => 1]; - break; + case 'InlineHTMLUnitTest.7.inc': return [1 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.php index 772d4c4a..10dcc702 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php index 4414753a..89243152 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; @@ -50,14 +50,13 @@ public function getErrorList($testFile='') 45 => 1, 82 => 1, ]; - break; + case 'LineLengthUnitTest.2.inc': case 'LineLengthUnitTest.3.inc': return [7 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() @@ -89,20 +88,19 @@ public function getWarningList($testFile='') 75 => 1, 84 => 1, ]; - break; + case 'LineLengthUnitTest.2.inc': case 'LineLengthUnitTest.3.inc': return [6 => 1]; - break; + case 'LineLengthUnitTest.4.inc': return [ 10 => 1, 14 => 1, ]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.php index f67a40a3..a0033a7a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.php index 42a96228..984daf71 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.php index f0831787..deced9a4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.php index 36a4bb93..d9e0fc21 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.php @@ -4,7 +4,7 @@ * * @author Mponos George * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php index 5519309e..9fe3e4d2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php @@ -4,7 +4,7 @@ * * @author Alexander Obuhovich * @copyright 2010-2014 Alexander Obuhovich - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.php index 84044d58..fb915990 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php index 23f2f9a7..eaf8afa5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Formatting; @@ -122,7 +122,7 @@ public function getWarningList($testFile='MultipleStatementAlignmentUnitTest.inc 499 => 1, 500 => 1, ]; - break; + case 'MultipleStatementAlignmentUnitTest.js': return [ 11 => 1, @@ -154,10 +154,9 @@ public function getWarningList($testFile='MultipleStatementAlignmentUnitTest.inc 114 => 1, 117 => 1, ]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.php index 58627615..b2f3f6da 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php index 505ded6c..85076656 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.php index 9019bb49..3b49e079 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.php index aed6b32a..cd229491 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.php index 1c10c99f..eee6288a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc index 7c86a89f..8bd067b3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc @@ -162,3 +162,13 @@ class Testing extends Bar $a = new parent($foo ,$bar); } } + +// Ignore spacing after PHP 7.3+ trailing comma in single-line function calls to prevent fixer conflicts. +// This is something which should be decided by a sniff dealing with the function call parentheses. +$foo = new MyClass($obj, 'getMethod',); +$foo = new MyClass($obj, 'getMethod', ); +$foo = new MyClass($obj, 'getMethod', ); +$foo = new MyClass( + $obj, + 'getMethod', +); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed index 8c980072..69676524 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed @@ -162,3 +162,13 @@ class Testing extends Bar $a = new parent($foo, $bar); } } + +// Ignore spacing after PHP 7.3+ trailing comma in single-line function calls to prevent fixer conflicts. +// This is something which should be decided by a sniff dealing with the function call parentheses. +$foo = new MyClass($obj, 'getMethod',); +$foo = new MyClass($obj, 'getMethod', ); +$foo = new MyClass($obj, 'getMethod', ); +$foo = new MyClass( + $obj, + 'getMethod', +); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php index 789b60b3..be92b743 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Functions; @@ -55,6 +55,7 @@ public function getErrorList() 154 => 2, 155 => 1, 162 => 2, + 170 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc index 3ae3b1ed..146f9cf6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc @@ -261,3 +261,10 @@ class Issue3357WithComment // code here. } } + + function myFunction() + {} + function myFunction() + {} // Too many spaces indent with an empty function. + function myFunction() +{} // Too little spaces indent with an empty function. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc.fixed index f164c493..ac4929d7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc.fixed @@ -278,3 +278,10 @@ class Issue3357WithComment // code here. } } + + function myFunction() + {} + function myFunction() + {} // Too many spaces indent with an empty function. + function myFunction() + {} // Too little spaces indent with an empty function. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.php index 10af4fd5..c8f218db 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Functions; @@ -61,6 +61,8 @@ public function getErrorList() 244 => 1, 252 => 1, 260 => 1, + 268 => 1, + 270 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc index f7b3c922..6c937a82 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc @@ -208,3 +208,7 @@ function myFunction($a, $lot, $of, $params) : array { // phpcs:ignore Standard.Category.Sniff -- for reasons. return null; } + +function myFunction() {} +function myFunction() {} // Too many spaces with an empty function. +function myFunction() {} // Too many spaces (tab) with an empty function. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc.fixed index 533fb567..bfb22838 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc.fixed @@ -196,3 +196,7 @@ function myFunction($a, $lot, $of, $params) : array { // phpcs:ignore Standard.Category.Sniff -- for reasons. return null; } + +function myFunction() {} +function myFunction() {} // Too many spaces with an empty function. +function myFunction() {} // Too many spaces (tab) with an empty function. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php index aee774f7..a2b32a85 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Functions; @@ -52,6 +52,8 @@ public function getErrorList() 191 => 1, 197 => 1, 203 => 1, + 213 => 1, + 214 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.php index d3860dff..77a30929 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Metrics; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.php index ccd75507..e9e44a3d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Metrics; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.php index 7be4e8f8..64450b42 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.php @@ -3,7 +3,7 @@ * Unit test class for the AbstractClassNamePrefix sniff. * * @author Anna Borzenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.php index 3d0320c3..795a6a74 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.php index e6c6df3f..2122f16b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.php index be23f7a6..66360bcf 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.php @@ -3,7 +3,7 @@ * Unit test class for the InterfaceNameSuffix sniff. * * @author Anna Borzenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.php index 742fdd1a..b8d5ba79 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.php @@ -3,7 +3,7 @@ * Unit test class for the TraitNameSuffix sniff. * * @author Anna Borzenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.php index 8db68c8a..de68dd60 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.inc index 3355c2d3..e2ca72d1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.inc @@ -1,2 +1,9 @@ * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; @@ -25,7 +25,10 @@ class BacktickOperatorUnitTest extends AbstractSniffUnitTest */ public function getErrorList() { - return [2 => 2]; + return [ + 2 => 2, + 9 => 2, + ]; }//end getErrorList() @@ -40,6 +43,7 @@ public function getErrorList() */ public function getWarningList() { + // Warning about incorrect annotation will be shown on line 1 once PR #3915 would be merged. return []; }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php index 11f4f14d..94dfd313 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; @@ -30,10 +30,9 @@ public function getErrorList($testFile='') switch ($testFile) { case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': return [2 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php index 9c567b7b..17efceb5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php @@ -4,7 +4,7 @@ * * @author Andy Grunwald * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; @@ -30,12 +30,12 @@ public function getErrorList($testFile='') switch ($testFile) { case 'ClosingPHPTagUnitTest.1.inc': return [9 => 1]; + case 'ClosingPHPTagUnitTest.2.inc': return [5 => 1]; - break; + default: return []; - break; } }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.php index d2f7cb80..32af71d2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php index 953e8ad9..90c9c137 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php index 7ece5512..05f6198e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php @@ -4,7 +4,7 @@ * * @author Jeantwan Teuma * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php index b79572ce..3edda9a5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.php index c1f82d61..f96b41bf 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc index b30f0dde..060da612 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc @@ -55,3 +55,6 @@ function mymodule_form_callback(SizeOf $sizeof) { } $size = $class?->sizeof($array); + +#[SizeOf(10)] +function doSomething() {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php index 760e8078..a0e86f23 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc index 0307a055..5dfb7556 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc @@ -98,3 +98,52 @@ class TypedThings { } $cl = function (int|FALSE $param = NULL, Type|NULL $obj = new MyObj(FALSE)) : string|FALSE|NULL {}; + +// Adding some extra tests to safeguard that function declarations which don't create scope are handled correctly. +interface InterfaceMethodsWithReturnTypeNoScopeOpener { + private function typed($param = TRUE) : string|FALSE|NULL; +} + +abstract class ClassMethodsWithReturnTypeNoScopeOpener { + abstract public function typed($param = FALSE) : TRUE; +} + +// Additional tests to safeguard improved property type skip logic. +readonly class Properties { + use SomeTrait { + sayHello as private myPrivateHello; + } + + public Type|FALSE|NULL $propertyA = array( + 'itemA' => TRUE, + 'itemB' => FALSE, + 'itemC' => NULL, + ), $propertyB = FALSE; + + protected \FullyQualified&Partially\Qualified&namespace\Relative $propertyC; + var ?TRUE $propertyD; + static array|callable|FALSE|self|parent $propertyE = TRUE; + private + // phpcs:ignore Stnd.Cat.Sniff -- for reasons. + TRUE /*comment*/ + $propertyF = TRUE; + + public function __construct( + public FALSE|NULL $promotedPropA, + readonly callable|TRUE $promotedPropB, + ) { + static $var; + echo static::class; + static::foo(); + $var = $var instanceof static; + $obj = new static(); + } + + public static function foo(): static|self|FALSE { + $callable = static function() {}; + } +} + +// Last coding/parse error. +// This has to be the last test in the file. +function UnclosedCurly (): FALSE { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc.fixed index 3a6b094c..6b999cc4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc.fixed @@ -98,3 +98,52 @@ class TypedThings { } $cl = function (int|FALSE $param = null, Type|NULL $obj = new MyObj(false)) : string|FALSE|NULL {}; + +// Adding some extra tests to safeguard that function declarations which don't create scope are handled correctly. +interface InterfaceMethodsWithReturnTypeNoScopeOpener { + private function typed($param = true) : string|FALSE|NULL; +} + +abstract class ClassMethodsWithReturnTypeNoScopeOpener { + abstract public function typed($param = false) : TRUE; +} + +// Additional tests to safeguard improved property type skip logic. +readonly class Properties { + use SomeTrait { + sayHello as private myPrivateHello; + } + + public Type|FALSE|NULL $propertyA = array( + 'itemA' => true, + 'itemB' => false, + 'itemC' => null, + ), $propertyB = false; + + protected \FullyQualified&Partially\Qualified&namespace\Relative $propertyC; + var ?TRUE $propertyD; + static array|callable|FALSE|self|parent $propertyE = true; + private + // phpcs:ignore Stnd.Cat.Sniff -- for reasons. + TRUE /*comment*/ + $propertyF = true; + + public function __construct( + public FALSE|NULL $promotedPropA, + readonly callable|TRUE $promotedPropB, + ) { + static $var; + echo static::class; + static::foo(); + $var = $var instanceof static; + $obj = new static(); + } + + public static function foo(): static|self|FALSE { + $callable = static function() {}; + } +} + +// Last coding/parse error. +// This has to be the last test in the file. +function UnclosedCurly (): FALSE { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php index 2fb2d6f6..5cb253ca 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; @@ -51,8 +51,16 @@ public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') 94 => 2, 95 => 1, 100 => 2, + 104 => 1, + 108 => 1, + 118 => 1, + 119 => 1, + 120 => 1, + 121 => 1, + 125 => 1, + 129 => 1, ]; - break; + case 'LowerCaseConstantUnitTest.js': return [ 2 => 1, @@ -64,10 +72,9 @@ public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') 13 => 1, 14 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php index 6d08e127..2d415eff 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc index 011adcd5..56393c0b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc @@ -92,3 +92,10 @@ function intersectionReturnTypes ($var): \Package\ClassName&\Package\Other_Class $arrow = fn (int $a, string $b, bool $c, array $d, Foo\Bar $e) : int => $a * $b; $arrow = fn (Int $a, String $b, BOOL $c, Array $d, Foo\Bar $e) : Float => $a * $b; + +$cl = function (False $a, TRUE $b, Null $c): ?True {}; + +// Intentional error, should be ignored by the sniff. +interface PropertiesNotAllowed { + public $notAllowed; +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed index d866101b..c1055c72 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed @@ -92,3 +92,10 @@ function intersectionReturnTypes ($var): \Package\ClassName&\Package\Other_Class $arrow = fn (int $a, string $b, bool $c, array $d, Foo\Bar $e) : int => $a * $b; $arrow = fn (int $a, string $b, bool $c, array $d, Foo\Bar $e) : float => $a * $b; + +$cl = function (false $a, true $b, null $c): ?true {}; + +// Intentional error, should be ignored by the sniff. +interface PropertiesNotAllowed { + public $notAllowed; +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php index fa05aba6..29d15c59 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; @@ -67,6 +67,7 @@ public function getErrorList() 82 => 2, 85 => 1, 94 => 5, + 96 => 4, ]; }//end getErrorList() @@ -82,7 +83,8 @@ public function getErrorList() */ public function getWarningList() { - return []; + // Warning from getMemberProperties() about parse error. + return [100 => 1]; }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php index 0e7a4eaa..a2d3ff8a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.10.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.10.inc new file mode 100644 index 00000000..1d12ccbf --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.10.inc @@ -0,0 +1,5 @@ + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; @@ -28,27 +28,38 @@ class RequireStrictTypesUnitTest extends AbstractSniffUnitTest public function getErrorList($testFile='') { switch ($testFile) { - case 'RequireStrictTypesUnitTest.1.inc': + case 'RequireStrictTypesUnitTest.2.inc': + case 'RequireStrictTypesUnitTest.5.inc': + case 'RequireStrictTypesUnitTest.6.inc': + case 'RequireStrictTypesUnitTest.10.inc': + return [1 => 1]; + + default: return []; - break; } - return [1 => 1]; - }//end getErrorList() /** * Returns the lines where warnings should occur. * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. + * @param string $testFile The name of the file being tested. * * @return array */ - public function getWarningList() + public function getWarningList($testFile='') { - return []; + switch ($testFile) { + case 'RequireStrictTypesUnitTest.11.inc': + case 'RequireStrictTypesUnitTest.12.inc': + case 'RequireStrictTypesUnitTest.14.inc': + case 'RequireStrictTypesUnitTest.15.inc': + return [3 => 1]; + + default: + return []; + } }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php index 08c0ccdc..24229b75 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php index 98d205ce..ea6d85d5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php @@ -5,7 +5,7 @@ * @author Greg Sherwood * @author Blaine Schmeisser * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; @@ -32,10 +32,9 @@ public function getErrorList($testFile='') case 'SyntaxUnitTest.1.inc': case 'SyntaxUnitTest.2.inc': return [3 => 1]; - break; + default: return []; - break; } }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php index 30e57763..486ab915 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php index 6a928482..a435c7f9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Strings; @@ -37,7 +37,7 @@ public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc') 19 => 1, 20 => 1, ]; - break; + case 'UnnecessaryStringConcatUnitTest.js': return [ 1 => 1, @@ -46,10 +46,9 @@ public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc') 14 => 1, 15 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php index 50986f48..050b08ee 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.php index d108974a..02d6a128 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; @@ -18,7 +18,7 @@ class SubversionPropertiesUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php index 0f70e287..36c220ae 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php index f915cf4a..48c0f312 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; @@ -85,7 +85,7 @@ public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') 117 => 1, 118 => 1, ]; - break; + case 'DisallowSpaceIndentUnitTest.3.inc': return [ 2 => 1, @@ -96,16 +96,15 @@ public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') 14 => 1, 15 => 1, ]; - break; + case 'DisallowSpaceIndentUnitTest.js': return [3 => 1]; - break; + case 'DisallowSpaceIndentUnitTest.css': return [2 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php index 816d24c8..2be60b74 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc index 22c611be..b674466b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc @@ -15,3 +15,23 @@ $i /*comment*/ --; $i++; $i ++; $i /*comment*/ ++; + +// Handle properties and array access too. +$i['key']++; +$i['key'] ++; +$i['key']['id']++; +$i['key']['id'] ++; + +$obj->prop++; +$obj->prop ++; +$obj?->prop ++; + +$obj->obj->prop++; +$obj->obj->prop ++; +$obj?->obj->prop ++; + +$obj->prop['key']++; +$obj->prop['key'] ++; + +--ClassName::$prop; +-- ClassName::$prop; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed index 7cf0ab81..1049e7e0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed @@ -14,3 +14,23 @@ $i /*comment*/ --; $i++; $i++; $i /*comment*/ ++; + +// Handle properties and array access too. +$i['key']++; +$i['key']++; +$i['key']['id']++; +$i['key']['id']++; + +$obj->prop++; +$obj->prop++; +$obj?->prop++; + +$obj->obj->prop++; +$obj->obj->prop++; +$obj?->obj->prop++; + +$obj->prop['key']++; +$obj->prop['key']++; + +--ClassName::$prop; +--ClassName::$prop; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php index 0959d673..9e7644f1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2018 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; @@ -27,19 +27,32 @@ class IncrementDecrementSpacingUnitTest extends AbstractSniffUnitTest */ public function getErrorList($testFile='IncrementDecrementSpacingUnitTest.inc') { + $errors = [ + 5 => 1, + 6 => 1, + 8 => 1, + 10 => 1, + 13 => 1, + 14 => 1, + 16 => 1, + 17 => 1, + ]; + switch ($testFile) { case 'IncrementDecrementSpacingUnitTest.inc': + $errors[21] = 1; + $errors[23] = 1; + $errors[26] = 1; + $errors[27] = 1; + $errors[30] = 1; + $errors[31] = 1; + $errors[34] = 1; + $errors[37] = 1; + + return $errors; + case 'IncrementDecrementSpacingUnitTest.js': - return [ - 5 => 1, - 6 => 1, - 8 => 1, - 10 => 1, - 13 => 1, - 14 => 1, - 16 => 1, - 17 => 1, - ]; + return $errors; default: return []; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php index 14c44da4..db42ad5b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php index 6b0a7102..23905fda 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.php index 07bf328c..c2f342ff 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php index 9575398a..9d02672d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\CSS; @@ -43,7 +43,7 @@ class BrowserSpecificStylesSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php index 81b7f1b6..d8458cad 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php index 2d56261c..7ae09f87 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; @@ -82,7 +82,7 @@ public function process(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the tokens array of the * potentially included class. * - * @return string + * @return bool */ protected function getIncludedClassFromToken( $phpcsFile, diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php index 8bbd91e8..85d7f765 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; @@ -19,7 +19,7 @@ class IncludeSystemSniff extends AbstractScopeSniff /** * A list of classes that don't need to be included. * - * @var string[] + * @var array */ private $ignore = [ 'self' => true, @@ -286,7 +286,7 @@ protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) * @param int $stackPtr The position in the tokens array of the * potentially included class. * - * @return string + * @return string|false */ protected function getIncludedClassFromToken(File $phpcsFile, array $tokens, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php index 6b10cd3e..9d6ca038 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php index fd75bcb2..d5f09b6f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php @@ -6,7 +6,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php index eccf6fe4..e43a10db 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php index 3115bac4..5e342d33 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php index 0a3c9cf2..7cfe208c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php index 8fb89376..7111e229 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php index cae7c08d..c53165ff 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php index 3914b7b8..2037ec14 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php @@ -7,7 +7,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php index 67b35723..64492c84 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php index 82419fcb..ff840bf2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php index 9b2029af..5d11550d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php index 311cf684..e94eba5e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php index 21353499..0018af24 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php index d29bf5c6..746637e9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php index 0320038e..c48d0fe5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php index fbc0ac70..6795d3fb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php index 5cc43b64..53c995c2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php index 78da9c94..73e697dc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php index 3a9c2358..039e8e84 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php index f28dff19..e758bd9e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php index a3c55bf3..4c94b00e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php index 333952f6..b562c379 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php index 315808bd..dda88b53 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php index 423f242d..25f481c7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php index 16e4cfb2..928de6eb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php index 32363786..fcc6bbce 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php index ecd490a4..85dd342d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\MySource\Tests\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php index dbd61f3d..ae9baad4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php index a01ea2cc..0934f11b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php @@ -4,13 +4,12 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; class ClassCommentSniff extends FileCommentSniff { @@ -48,8 +47,12 @@ public function process(File $phpcsFile, $stackPtr) $type = strtolower($tokens[$stackPtr]['content']); $errorData = [$type]; - $find = Tokens::$methodPrefixes; - $find[T_WHITESPACE] = T_WHITESPACE; + $find = [ + T_ABSTRACT => T_ABSTRACT, + T_FINAL => T_FINAL, + T_READONLY => T_READONLY, + T_WHITESPACE => T_WHITESPACE, + ]; for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { if (isset($find[$tokens[$commentEnd]['code']]) === true) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php index 6a445846..2af57b18 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; @@ -88,7 +88,7 @@ public function register() * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * - * @return int + * @return int|void */ public function process(File $phpcsFile, $stackPtr) { @@ -170,6 +170,7 @@ public function process(File $phpcsFile, $stackPtr) T_FINAL, T_STATIC, T_ABSTRACT, + T_READONLY, T_CONST, T_PROPERTY, ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php index 408856fc..ffa5cb8e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; @@ -129,11 +129,25 @@ public function process(File $phpcsFile, $stackPtr) && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] ) { $error = 'There must be no blank lines after the function comment'; - $phpcsFile->addError($error, $commentEnd, 'SpacingAfter'); + $fix = $phpcsFile->addFixableError($error, $commentEnd, 'SpacingAfter'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + while ($i < $stackPtr + && $tokens[$i]['code'] === T_WHITESPACE + && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] + ) { + $phpcsFile->fixer->replaceToken($i++, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + break; } - } - } + }//end for + }//end if $commentStart = $tokens[$commentEnd]['comment_opener']; foreach ($tokens[$commentStart]['comment_tags'] as $tag) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php index aa9f3753..313f74d2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php index edd2d6be..4ca5451b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php index fff62bb1..f4073735 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php index 04f208de..763b50c4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php @@ -6,7 +6,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php index 0a7ff7db..f7b75cb0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php index b5e8695c..30e0f67a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; @@ -340,7 +340,8 @@ public function processMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $ // call itself is, so we can work out how far to // indent the arguments. $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - if ($tokens[$first]['code'] === T_CONSTANT_ENCAPSED_STRING + if ($first !== false + && $tokens[$first]['code'] === T_CONSTANT_ENCAPSED_STRING && $tokens[($first - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING ) { // We are in a multi-line string, so find the start and use @@ -386,8 +387,10 @@ public function processMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $ $fix = $phpcsFile->addFixableError($error, $first, 'OpeningIndent', $data); if ($fix === true) { + // Set adjustment for use later to determine whether argument indentation is correct when fixing. $adjustment = ($functionIndent - $foundFunctionIndent); - $padding = str_repeat(' ', $functionIndent); + + $padding = str_repeat(' ', $functionIndent); if ($foundFunctionIndent === 0) { $phpcsFile->fixer->addContentBefore($first, $padding); } else if ($tokens[$first]['code'] === T_INLINE_HTML) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php index bd59a7cd..4cc24a2d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; @@ -297,63 +297,74 @@ public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) return; } - // The opening brace needs to be one space away from the closing parenthesis. + // The opening brace needs to be on the same line as the closing parenthesis. + // There should only be one space between the closing parenthesis - or the end of the + // return type - and the opening brace. $opener = $tokens[$stackPtr]['scope_opener']; if ($tokens[$opener]['line'] !== $tokens[$closeBracket]['line']) { $error = 'The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line'; - $fix = $phpcsFile->addFixableError($error, $opener, 'NewlineBeforeOpenBrace'); - if ($fix === true) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), $closeBracket, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($prev, ' {'); - - // If the opener is on a line by itself, removing it will create - // an empty line, so just remove the entire line instead. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), $closeBracket, true); - $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); + $code = 'NewlineBeforeOpenBrace'; - if ($tokens[$prev]['line'] < $tokens[$opener]['line'] - && $tokens[$next]['line'] > $tokens[$opener]['line'] - ) { - // Clear the whole line. - for ($i = ($prev + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } else { - // Just remove the opener. - $phpcsFile->fixer->replaceToken($opener, ''); - if ($tokens[$next]['line'] === $tokens[$opener]['line']) { - $phpcsFile->fixer->replaceToken(($opener + 1), ''); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - $prev = $tokens[($opener - 1)]; - if ($prev['code'] !== T_WHITESPACE) { - $length = 0; + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), $closeBracket, true); + if ($tokens[$prev]['line'] === $tokens[$opener]['line']) { + // End of the return type is not on the same line as the close parenthesis. + $phpcsFile->addError($error, $opener, $code); } else { - $length = strlen($prev['content']); - } - - if ($length !== 1) { - $error = 'There must be a single space between the closing parenthesis and the opening brace of a multi-line function declaration; found %s spaces'; - $fix = $phpcsFile->addFixableError($error, ($opener - 1), 'SpaceBeforeOpenBrace', [$length]); + $fix = $phpcsFile->addFixableError($error, $opener, $code); if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContentBefore($opener, ' '); + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($prev, ' {'); + + // If the opener is on a line by itself, removing it will create + // an empty line, so remove the entire line instead. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), $closeBracket, true); + $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); + + if ($tokens[$prev]['line'] < $tokens[$opener]['line'] + && $tokens[$next]['line'] > $tokens[$opener]['line'] + ) { + // Clear the whole line. + for ($i = ($prev + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$opener]['line']) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } } else { - $phpcsFile->fixer->replaceToken(($opener - 1), ' '); + // Just remove the opener. + $phpcsFile->fixer->replaceToken($opener, ''); + if ($tokens[$next]['line'] === $tokens[$opener]['line'] + && ($opener + 1) !== $next + ) { + $phpcsFile->fixer->replaceToken(($opener + 1), ''); + } } - } + + $phpcsFile->fixer->endChangeset(); + }//end if return; }//end if }//end if + $prev = $tokens[($opener - 1)]; + if ($prev['code'] !== T_WHITESPACE) { + $length = 0; + } else { + $length = strlen($prev['content']); + } + + if ($length !== 1) { + $error = 'There must be a single space between the closing parenthesis/return type and the opening brace of a multi-line function declaration; found %s spaces'; + $fix = $phpcsFile->addFixableError($error, ($opener - 1), 'SpaceBeforeOpenBrace', [$length]); + if ($fix === true) { + if ($length === 0) { + $phpcsFile->fixer->addContentBefore($opener, ' '); + } else { + $phpcsFile->fixer->replaceToken(($opener - 1), ' '); + } + } + } + }//end processMultiLineDeclaration() @@ -496,6 +507,19 @@ public function processArgumentList($phpcsFile, $stackPtr, $indent, $type='funct $lastLine = $tokens[$i]['line']; }//end if + if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS + && isset($tokens[$i]['parenthesis_closer']) === true + ) { + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); + if ($tokens[$prevNonEmpty]['code'] !== T_USE) { + // Since PHP 8.1, a default value can contain a class instantiation. + // Skip over these "function calls" as they have their own indentation rules. + $i = $tokens[$i]['parenthesis_closer']; + $lastLine = $tokens[$i]['line']; + continue; + } + } + if ($tokens[$i]['code'] === T_ARRAY || $tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { // Skip arrays as they have their own indentation rules. if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php index f1347078..1e38cc09 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php index 00e68bfe..e50fd1f5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php index e7f87d44..b1521aa6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php index 89af5df8..48674b1e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php index fb1b79a3..d333a553 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php index 097754e5..2b51a8a6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php index 2620d20f..e95dc8bd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php index 4c1d28e7..2ee177cf 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc index da53b99e..bd7d0618 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc @@ -31,7 +31,7 @@ class Invalid_Comment_Style1 * @package PHP_CodeSniffer * @author Greg Sherwood * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @version Release: 1.0 * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -47,7 +47,7 @@ class Extra_Description_Newlines * @package PHP_CodeSniffer * @author Greg Sherwood * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @version * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -136,10 +136,28 @@ enum Empty_Enum_Doc * @category PHP * @package PHP_CodeSniffer * @author Greg Sherwood - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence * @link http://pear.php.net/package/PHP_CodeSniffer */ #[Authenticate('admin_logged_in')] class TodoController extends AbstractController implements MustBeLoggedInInterface { } + +/** + * Docblock + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +abstract readonly class AbstractReadonlyWithDocblock {} + +/* + * Docblock + */ +readonly class ReadonlyWrongStyle {} + +readonly final class ReadonlyFinalWithoutDocblock {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php index 004a064b..e0e98bd3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; @@ -45,6 +45,8 @@ public function getErrorList() 106 => 5, 116 => 5, 126 => 5, + 161 => 1, + 163 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.4.inc new file mode 100644 index 00000000..3c4f6359 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.4.inc @@ -0,0 +1,7 @@ + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; @@ -48,9 +48,8 @@ public function getErrorList($testFile='FileCommentUnitTest.inc') ]; case 'FileCommentUnitTest.2.inc': - return [1 => 1]; - case 'FileCommentUnitTest.3.inc': + case 'FileCommentUnitTest.4.inc': return [1 => 1]; default: diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc index 5c3295fd..a20ba3a7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc @@ -476,3 +476,37 @@ class Something implements JsonSerializable { public function blankLineDetectionC() {} } + +class SpacingAfter { + /** + * There are multiple blank lines between this comment and the next function. + * + * @return void + */ + + + + + + + + + public function multipleBlankLines() {} + + /** + * There are multiple blank lines, and some "empty" lines with only + * spaces/tabs between this comment and the next function. + * + * @return void + */ + + + + + + + + + + public function multipleLinesSomeEmpty() {} +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed index 751b09c6..fc6d4f7e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed @@ -453,7 +453,6 @@ class Something implements JsonSerializable { * * @return mixed */ - #[ReturnTypeWillChange] public function blankLineDetectionA() {} @@ -463,7 +462,6 @@ class Something implements JsonSerializable { * @return mixed */ #[ReturnTypeWillChange] - public function blankLineDetectionB() {} /** @@ -471,8 +469,23 @@ class Something implements JsonSerializable { * * @return mixed */ - #[ReturnTypeWillChange] - public function blankLineDetectionC() {} } + +class SpacingAfter { + /** + * There are multiple blank lines between this comment and the next function. + * + * @return void + */ + public function multipleBlankLines() {} + + /** + * There are multiple blank lines, and some "empty" lines with only + * spaces/tabs between this comment and the next function. + * + * @return void + */ + public function multipleLinesSomeEmpty() {} +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php index 734ff73e..6283c4a6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; @@ -73,6 +73,8 @@ public function getErrorList() 455 => 1, 464 => 1, 473 => 1, + 485 => 1, + 501 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.php index 6cc5cd3b..3c06d151 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php index 98c3463b..f9f72378 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php index f78b4e3f..9a9b1ca4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.php index ab3ea8ac..9661f440 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php index 734d4fce..e419b52b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc index 612748fe..fddd3cba 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc @@ -567,3 +567,10 @@ content

+ + + + + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed index 00226de5..1c525230 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed @@ -582,3 +582,10 @@ content

+ + + + + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php index 4984de2b..4e0eeffb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; @@ -134,6 +134,8 @@ public function getErrorList($testFile='FunctionCallSignatureUnitTest.inc') 559 => 1, 567 => 1, 568 => 1, + 573 => 1, + 574 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc index 02e0a20d..6ba3bd9f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc @@ -418,3 +418,73 @@ class ConstructorPropertyPromotionMultiLineAttributesIncorrectIndent // Do something. } } + +// PHP 8.1: new in initializers means that class instantiations with parameters can occur in a function declaration. +function usingNewInInitializersCallParamsIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA(), + new InjectedDependencyB + ) +) {} + +function usingNewInInitializersCallParamsNotIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA, + new InjectedDependencyB() + ) +) {} + +function usingNewInInitializersCallParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + int $paramA, + string $paramB, + object $paramC = new SomeClass( +new InjectedDependencyA(), new InjectedDependencyB() +) +) {} + +class UsingNewInInitializers { + public function doSomething( + object $paramA, + stdClass $paramB = new stdClass(), + Exception $paramC = new Exception( + new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } + + public function callParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + Exception $param = new Exception( +new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } +} + +// Issue #3736 - prevent the fixer creating a parse error by removing the function close brace. +class Test +{ + public function __construct( + protected int $id + ) + {} +} + +// Prevent fixer conflict with itself. +function foo( + $param1, +) +: \SomeClass + { + } + +function foo( + $param1, + $param2 +) : // comment. + \Package\Sub\SomeClass {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc.fixed index 0d67e9f7..8248ee1d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc.fixed @@ -416,3 +416,72 @@ class ConstructorPropertyPromotionMultiLineAttributesIncorrectIndent // Do something. } } + +// PHP 8.1: new in initializers means that class instantiations with parameters can occur in a function declaration. +function usingNewInInitializersCallParamsIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA(), + new InjectedDependencyB + ) +) {} + +function usingNewInInitializersCallParamsNotIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA, + new InjectedDependencyB() + ) +) {} + +function usingNewInInitializersCallParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + int $paramA, + string $paramB, + object $paramC = new SomeClass( +new InjectedDependencyA(), new InjectedDependencyB() +) +) {} + +class UsingNewInInitializers { + public function doSomething( + object $paramA, + stdClass $paramB = new stdClass(), + Exception $paramC = new Exception( + new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } + + public function callParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + Exception $param = new Exception( +new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } +} + +// Issue #3736 - prevent the fixer creating a parse error by removing the function close brace. +class Test +{ + public function __construct( + protected int $id + ) { + } +} + +// Prevent fixer conflict with itself. +function foo( + $param1, +) +: \SomeClass { + } + +function foo( + $param1, + $param2 +) : // comment. + \Package\Sub\SomeClass {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php index 01ab3e84..d12c8c08 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; @@ -99,6 +99,9 @@ public function getErrorList($testFile='FunctionDeclarationUnitTest.inc') 371 => 1, 402 => 1, 406 => 1, + 475 => 1, + 483 => 1, + 490 => 2, ]; } else { $errors = [ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php index 60d261cb..668611d8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.php index 54ee74aa..3fbbb384 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.php index 4639a1e2..a3a33d97 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php index 834852c3..d1a333e7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php index 0cad3efc..63a8fc82 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php index 26593254..197a50fa 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php index 0857021b..ed1825b3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php index 3db26f6f..19161d77 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php index 3f8c5e0d..e92ffb55 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Files; @@ -36,7 +36,7 @@ public function register() * @param int $stackPtr The position of the current token in * the token stack. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { @@ -103,7 +103,8 @@ private function searchForConflict($phpcsFile, $start, $end, $tokens) && (empty($tokens[$i]['sniffCodes']) === true || isset($tokens[$i]['sniffCodes']['PSR1']) === true || isset($tokens[$i]['sniffCodes']['PSR1.Files']) === true - || isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects']) === true) + || isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects']) === true + || isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects.FoundWithSymbols']) === true) ) { do { $i = $phpcsFile->findNext(T_PHPCS_ENABLE, ($i + 1)); @@ -111,7 +112,8 @@ private function searchForConflict($phpcsFile, $start, $end, $tokens) && empty($tokens[$i]['sniffCodes']) === false && isset($tokens[$i]['sniffCodes']['PSR1']) === false && isset($tokens[$i]['sniffCodes']['PSR1.Files']) === false - && isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects']) === false); + && isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects']) === false + && isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects.FoundWithSymbols']) === false); if ($i === false) { // The entire rest of the file is disabled, @@ -169,7 +171,9 @@ private function searchForConflict($phpcsFile, $start, $end, $tokens) } // Ignore function/class prefixes. - if (isset(Tokens::$methodPrefixes[$tokens[$i]['code']]) === true) { + if (isset(Tokens::$methodPrefixes[$tokens[$i]['code']]) === true + || $tokens[$i]['code'] === T_READONLY + ) { continue; } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php index 2d138146..0cf1022f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.php index 7c03a9f4..600fec99 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR1\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc index ca538823..b7e1dc9a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc @@ -76,4 +76,12 @@ namespace { defined('APP_BASE_URL') or define('APP_BASE_URL', '/'); +readonly class Foo { + public function __construct( + private string $foo, + private string $bar, + ) { + } +} + ?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc new file mode 100644 index 00000000..ec81bfed --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc @@ -0,0 +1,8 @@ + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR1\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.php index 0b1ef713..a3133de4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR1\Tests\Methods; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php index db67fb94..fd8e81a3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; @@ -97,7 +97,11 @@ public function process(File $phpcsFile, $stackPtr) $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); $indent = str_repeat(' ', ($tokens[$first]['column'] - 1)); $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($prev + 1), ''); + + if ($tokens[($prev + 1)]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($prev + 1), ''); + } + $phpcsFile->fixer->addNewline($prev); $phpcsFile->fixer->addContentBefore($opener, $indent); $phpcsFile->fixer->endChangeset(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php index 2298da39..40e928bd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php index fa1f8d60..6571af5b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php index 83ffda4d..d2a2c5bd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php index b87c3391..e86ff4f2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php index 3d29c4ac..499f3a29 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; @@ -38,7 +38,6 @@ public function register() T_FOREACH, T_FOR, T_SWITCH, - T_ELSE, T_ELSEIF, T_CATCH, T_MATCH, diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php index 67776c33..95357a78 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php @@ -4,7 +4,7 @@ * * @author Sertan Danis * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php index 8a8255cf..99c9de2b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; @@ -36,7 +36,7 @@ public function register() * @param int $stackPtr The position of the current * token in the stack. * - * @return int|null + * @return int|void */ public function process(File $phpcsFile, $stackPtr) { @@ -188,6 +188,7 @@ public function getHeaderLines(File $phpcsFile, $stackPtr) if (isset($commentOpeners[$tokens[$docToken]['code']]) === false && isset(Tokens::$methodPrefixes[$tokens[$docToken]['code']]) === false + && $tokens[$docToken]['code'] !== T_READONLY ) { // Check for an @var annotation. $annotation = false; @@ -283,7 +284,7 @@ public function getHeaderLines(File $phpcsFile, $stackPtr) * @param array $headerLines Header information, as sourced * from getHeaderLines(). * - * @return int|null + * @return void */ public function processHeaderLines(File $phpcsFile, $headerLines) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php index 176aef00..627b3293 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php index 4371bee1..6c80d812 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; @@ -44,25 +44,28 @@ public function process(File $phpcsFile, $stackPtr) return $phpcsFile->numTokens; } - $next = $phpcsFile->findNext(T_INLINE_HTML, 0); - if ($next !== false) { - // This rule only applies to PHP-only files. - return $phpcsFile->numTokens; - } - $tokens = $phpcsFile->getTokens(); $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); if ($next === false) { // Empty file. - return; + return $phpcsFile->numTokens; + } + + if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { + // Tag is on a line by itself. + return $phpcsFile->numTokens; + } + + $next = $phpcsFile->findNext(T_INLINE_HTML, 0); + if ($next !== false) { + // This rule only applies to PHP-only files. + return $phpcsFile->numTokens; } - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Opening PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAlone'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($stackPtr); - } + $error = 'Opening PHP tag must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAlone'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($stackPtr); } return $phpcsFile->numTokens; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php index 8d907343..ac0775d1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; @@ -27,6 +27,9 @@ class NullableTypeDeclarationSniff implements Sniff T_SELF => true, T_PARENT => true, T_STATIC => true, + T_NULL => true, + T_FALSE => true, + T_TRUE => true, ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php index 14d91e2e..61c45f5e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php index adf04d90..e79fe38b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php index 725fbde3..f87ced05 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php index 8757e05a..c3b48f47 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php index 7f63d1e8..5d688258 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php index 113e8b9f..f9fb808a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits; @@ -36,7 +36,7 @@ public function register() * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * - * @return void + * @return void|int */ public function process(File $phpcsFile, $stackPtr) { @@ -177,6 +177,38 @@ public function process(File $phpcsFile, $stackPtr) }//end if }//end if + $error = 'Expected 1 space after USE in trait import statement; %s found'; + if ($tokens[($useToken + 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $useToken, 'SpaceAfterUse', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($useToken, ' '); + } + } else if ($tokens[($useToken + 1)]['content'] !== ' ') { + $next = $phpcsFile->findNext(T_WHITESPACE, ($useToken + 1), null, true); + if ($tokens[$next]['line'] !== $tokens[$useToken]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($useToken + 1)]['length']; + } + + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $useToken, 'SpaceAfterUse', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($useToken + 1); $x < $next; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContent($useToken, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($useToken + 1), ' '); + } + } + }//end if + // Check the formatting of the statement. if (isset($tokens[$useToken]['scope_opener']) === true) { $this->processUseGroup($phpcsFile, $useToken); @@ -652,38 +684,6 @@ protected function processUseStatement(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - $error = 'Expected 1 space after USE in trait import statement; %s found'; - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterAs', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } else if ($tokens[($stackPtr + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterAs', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($stackPtr + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($stackPtr, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - $next = $phpcsFile->findNext([T_COMMA, T_SEMICOLON], ($stackPtr + 1)); if ($next !== false && $tokens[$next]['code'] === T_COMMA) { $error = 'Each imported trait must have its own "use" import statement'; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc index e132b54d..fe3ee02e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc @@ -82,3 +82,9 @@ $foo->bar( foo(new class { }); + +// Issue #3790: OpenBraceSameLine fixer should not remove open brace. +$instance = new class() extends SomeClass implements + SomeInterface{ + public function __construct() {} +}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed index 921dcc02..4a6c5a1f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed @@ -84,3 +84,10 @@ $foo->bar( foo(new class { }); + +// Issue #3790: OpenBraceSameLine fixer should not remove open brace. +$instance = new class () extends SomeClass implements + SomeInterface +{ + public function __construct() {} +}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php index cc162b29..6f396262 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; @@ -48,6 +48,8 @@ public function getErrorList() 56 => 2, 63 => 1, 75 => 1, + 87 => 1, + 88 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php index 0a16af8f..3df377b7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php index d402f1bb..a397a8d7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.php index 71d9d6f4..3005276f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php index 3eeaeebc..d883c5d3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php index 6ee076f2..6639e1e8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.php index 5e75d98a..acd407be 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.php @@ -4,7 +4,7 @@ * * @author Sertan Danis * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.18.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.18.inc new file mode 100644 index 00000000..be7c11ac --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.18.inc @@ -0,0 +1,16 @@ + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php index 04590b97..7ddd42be 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.php index b94043a3..8ce5633e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc index e3a5a775..056d74c3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc @@ -85,3 +85,11 @@ class testInstanceOf() { // PHP 8.0: static return type. function testStatic() : ? static {} + +// PHP 8.2: nullable true/false. +function fooG(): ? true {} +function fooH(): ? + false {} + +// Fatal error: null cannot be marked as nullable, but that's not the concern of this sniff. +function fooI(): ? null {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc.fixed index 6225d1b3..6cc418d0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc.fixed @@ -83,3 +83,10 @@ class testInstanceOf() { // PHP 8.0: static return type. function testStatic() : ?static {} + +// PHP 8.2: nullable true/false. +function fooG(): ?true {} +function fooH(): ?false {} + +// Fatal error: null cannot be marked as nullable, but that's not the concern of this sniff. +function fooI(): ?null {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.php index 2344b6d9..da11498a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; @@ -41,6 +41,9 @@ protected function getErrorList() 58 => 2, 59 => 2, 87 => 1, + 90 => 1, + 91 => 1, + 95 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php index fc6b5e19..edc0d8e0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php index 460cd55f..3e9d9eca 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Keywords; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.php index 41e9db77..cbc56809 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Namespaces; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php index e23fd968..1a14da8a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Operators; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.php index b738706d..e27bc487 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Properties; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc index c8ad746a..152121cf 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc @@ -54,7 +54,7 @@ class ClassName7 class ClassName8 { - use A , B, + use A , B, C { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.php index 797a2912..2b895e19 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR12\Tests\Traits; @@ -30,7 +30,7 @@ public function getErrorList() 29 => 2, 30 => 1, 42 => 1, - 57 => 3, + 57 => 4, 59 => 3, 61 => 1, 63 => 5, diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml new file mode 100644 index 00000000..60d5e7fb --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + ]]> + + + ?> + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml new file mode 100644 index 00000000..257bcab0 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml @@ -0,0 +1,107 @@ + + + + + + + ($bar, $baz); + ]]> + + + ( $bar, $baz ); + ]]> + + + + + $bar, + $baz +); + ]]> + + + $bar, + $baz +); + ]]> + + + + + ); + ]]> + + + ); + ]]> + + + + + $bar, + $baz +); + ]]> + + + $bar, + $baz +); + ]]> + + + + + $baz +); + ]]> + + + $baz +); + ]]> + + + + + + + + + $baz +); + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml new file mode 100644 index 00000000..3b1b6555 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml @@ -0,0 +1,26 @@ + + + + + + + } + ]]> + + + +} + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php index f96b0049..6d59b89a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; @@ -71,7 +71,7 @@ public function processOpen(File $phpcsFile, $stackPtr) $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); $spaces = strlen($blankSpace); - if (in_array($tokens[($stackPtr - 2)]['code'], [T_ABSTRACT, T_FINAL], true) === true + if (in_array($tokens[($stackPtr - 2)]['code'], [T_ABSTRACT, T_FINAL, T_READONLY], true) === true && $spaces !== 1 ) { $prevContent = strtolower($tokens[($stackPtr - 2)]['content']); @@ -89,6 +89,7 @@ public function processOpen(File $phpcsFile, $stackPtr) } } else if ($tokens[($stackPtr - 2)]['code'] === T_ABSTRACT || $tokens[($stackPtr - 2)]['code'] === T_FINAL + || $tokens[($stackPtr - 2)]['code'] === T_READONLY ) { $prevContent = strtolower($tokens[($stackPtr - 2)]['content']); $error = 'Expected 1 space between %s and %s keywords; newline found'; @@ -491,12 +492,12 @@ public function processClose(File $phpcsFile, $stackPtr) if ($fix === true) { $phpcsFile->fixer->beginChangeset(); - for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { + for ($i = ($prevContent + 1); $tokens[$i]['line'] !== $tokens[$closeBrace]['line']; $i++) { $phpcsFile->fixer->replaceToken($i, ''); } if (strpos($tokens[$prevContent]['content'], $phpcsFile->eolChar) === false) { - $phpcsFile->fixer->replaceToken($closeBrace, $phpcsFile->eolChar.$tokens[$closeBrace]['content']); + $phpcsFile->fixer->addNewline($prevContent); } $phpcsFile->fixer->endChangeset(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php index efdbb438..550e0458 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; @@ -118,30 +118,70 @@ protected function processMemberVar(File $phpcsFile, $stackPtr) $phpcsFile->addError($error, $stackPtr, 'ScopeMissing', $data); } + /* + * Note: per PSR-PER section 4.6, the order should be: + * - Inheritance modifier: `abstract` or `final`. + * - Visibility modifier: `public`, `protected`, or `private`. + * - Scope modifier: `static`. + * - Mutation modifier: `readonly`. + * - Type declaration. + * - Name. + * + * Ref: https://www.php-fig.org/per/coding-style/#46-modifier-keywords + * + * At this time (PHP 8.2), inheritance modifiers cannot be applied to properties and + * the `static` and `readonly` modifiers are mutually exclusive and cannot be used together. + * + * Based on that, the below modifier keyword order checks are sufficient (for now). + */ + if ($propertyInfo['scope_specified'] === true && $propertyInfo['is_static'] === true) { $scopePtr = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($stackPtr - 1)); $staticPtr = $phpcsFile->findPrevious(T_STATIC, ($stackPtr - 1)); - if ($scopePtr < $staticPtr) { - return; - } + if ($scopePtr > $staticPtr) { + $error = 'The static declaration must come after the visibility declaration'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'StaticBeforeVisibility'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); - $error = 'The static declaration must come after the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'StaticBeforeVisibility'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); + for ($i = ($scopePtr + 1); $scopePtr < $stackPtr; $i++) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } - for ($i = ($scopePtr + 1); $scopePtr < $stackPtr; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; + $phpcsFile->fixer->replaceToken($i, ''); } - $phpcsFile->fixer->replaceToken($i, ''); + $phpcsFile->fixer->replaceToken($scopePtr, ''); + $phpcsFile->fixer->addContentBefore($staticPtr, $propertyInfo['scope'].' '); + + $phpcsFile->fixer->endChangeset(); } + } + }//end if + + if ($propertyInfo['scope_specified'] === true && $propertyInfo['is_readonly'] === true) { + $scopePtr = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($stackPtr - 1)); + $readonlyPtr = $phpcsFile->findPrevious(T_READONLY, ($stackPtr - 1)); + if ($scopePtr > $readonlyPtr) { + $error = 'The readonly declaration must come after the visibility declaration'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ReadonlyBeforeVisibility'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = ($scopePtr + 1); $scopePtr < $stackPtr; $i++) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } - $phpcsFile->fixer->replaceToken($scopePtr, ''); - $phpcsFile->fixer->addContentBefore($staticPtr, $propertyInfo['scope'].' '); + $phpcsFile->fixer->replaceToken($scopePtr, ''); + $phpcsFile->fixer->addContentBefore($readonlyPtr, $propertyInfo['scope'].' '); - $phpcsFile->fixer->endChangeset(); + $phpcsFile->fixer->endChangeset(); + } } }//end if diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php index 09d2c14a..4a32091c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; @@ -44,7 +44,6 @@ public function register() T_FOREACH, T_FOR, T_SWITCH, - T_ELSE, T_ELSEIF, T_CATCH, T_MATCH, diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php index 9f97684a..fa89cfee 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php index de81c530..a63ba881 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; @@ -241,7 +241,7 @@ private function findNextCase($phpcsFile, $stackPtr, $end) * @param int $stackPtr The position to start looking at. * @param int $end The position to stop looking at. * - * @return int|false + * @return int|bool */ private function findNestedTerminator($phpcsFile, $stackPtr, $end) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php index 39834b38..ef1dc052 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php index aed461f8..98693f86 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; @@ -38,7 +38,7 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php index 406f2794..cee18cac 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; @@ -35,7 +35,7 @@ class FunctionCallSignatureSniff extends PEARFunctionCallSignatureSniff * @param array $tokens The stack of tokens that make up * the file. * - * @return void + * @return bool */ public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php index 1e11f02f..4f1716b1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php index d23b8bee..6500d046 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php index bf37af09..2f6bb64f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php index aba9caa7..ba71c309 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc index 13e596e1..f241a1a2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc @@ -239,3 +239,21 @@ C8 foo(new class { }); + +readonly +class Test +{ +} + +readonly class Test +{ +} + +if (!class_exists('IndentedDeclaration')) { + class IndentedDeclaration + { + function foo() {} + + + } +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed index 3ee394e7..bb723187 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed @@ -232,3 +232,18 @@ class C8 foo(new class { }); + +readonly class Test +{ +} + +readonly class Test +{ +} + +if (!class_exists('IndentedDeclaration')) { + class IndentedDeclaration + { + function foo() {} + } +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php index 635ac710..0d947468 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; @@ -63,6 +63,9 @@ public function getErrorList() 216 => 1, 231 => 2, 235 => 1, + 244 => 1, + 248 => 1, + 258 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc index 33bec44e..3e086c6f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc @@ -80,4 +80,8 @@ class ReadOnlyProp { protected readonly ?string $foo; readonly array $foo; + + readonly public int $wrongOrder1; + + readonly protected ?string $wrongOrder2; } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed index df83112a..c4e22fc1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed @@ -77,4 +77,8 @@ class ReadOnlyProp { protected readonly ?string $foo; readonly array $foo; + + public readonly int $wrongOrder1; + + protected readonly ?string $wrongOrder2; } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php index f1dd0194..6c6c662e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; @@ -49,6 +49,8 @@ public function getErrorList() 76 => 1, 80 => 1, 82 => 1, + 84 => 1, + 86 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php index 35d5e515..7c67b923 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php index 935205b4..6036ab0f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php index 0cd946d8..84a1c7e5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.php index 619f0249..5be71d12 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.php index 456106fe..ccb9fea2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php index 1d878258..7f6ce1f9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.php index 2497f35b..6e99abec 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.php index a8dcdfea..f7a78f21 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.php index 71f7bec1..8579b3b7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.php index b424a2c1..a62eaad9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php index ee63dead..22dda0ed 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php index b45a4709..f9e4ec03 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; @@ -330,11 +330,17 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array } } else if ($tokens[$arrayEnd]['column'] !== $keywordStart) { // Check the closing bracket is lined up under the "a" in array. - $expected = ($keywordStart - 1); - $found = ($tokens[$arrayEnd]['column'] - 1); - $error = 'Closing parenthesis not aligned correctly; expected %s space(s) but found %s'; - $data = [ + $expected = ($keywordStart - 1); + $found = ($tokens[$arrayEnd]['column'] - 1); + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Closing parenthesis not aligned correctly; expected %s space%s but found %s'; + $data = [ $expected, + $pluralizeSpace, $found, ]; @@ -430,9 +436,13 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array } if ($keyUsed === true && $tokens[$lastToken]['code'] === T_COMMA) { - $error = 'No key specified for array entry; first entry specifies key'; - $phpcsFile->addError($error, $nextToken, 'NoKeySpecified'); - return; + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($lastToken + 1), null, true); + // Allow for PHP 7.4+ array unpacking within an array declaration. + if ($tokens[$nextToken]['code'] !== T_ELLIPSIS) { + $error = 'No key specified for array entry; first entry specifies key'; + $phpcsFile->addError($error, $nextToken, 'NoKeySpecified'); + return; + } } if ($keyUsed === false) { @@ -470,8 +480,17 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array true ); - $indices[] = ['value' => $valueContent]; - $singleUsed = true; + $indices[] = ['value' => $valueContent]; + $usesArrayUnpacking = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($nextToken - 2), + null, + true + ); + if ($tokens[$usesArrayUnpacking]['code'] !== T_ELLIPSIS) { + // Don't decide if an array is key => value indexed or not when PHP 7.4+ array unpacking is used. + $singleUsed = true; + } }//end if $lastToken = $nextToken; @@ -661,12 +680,18 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array } else if ($previousIsWhitespace === true) { $expected = $keywordStart; - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $valuePointer, true); - $found = ($tokens[$first]['column'] - 1); + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $valuePointer, true); + $found = ($tokens[$first]['column'] - 1); + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + if ($found !== $expected) { - $error = 'Array value not aligned correctly; expected %s spaces but found %s'; + $error = 'Array value not aligned correctly; expected %s space%s but found %s'; $data = [ $expected, + $pluralizeSpace, $found, ]; @@ -750,11 +775,17 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array } if ($tokens[$indexPointer]['column'] !== $indicesStart && ($indexPointer - 1) !== $arrayStart) { - $expected = ($indicesStart - 1); - $found = ($tokens[$indexPointer]['column'] - 1); - $error = 'Array key not aligned correctly; expected %s spaces but found %s'; - $data = [ + $expected = ($indicesStart - 1); + $found = ($tokens[$indexPointer]['column'] - 1); + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array key not aligned correctly; expected %s space%s but found %s'; + $data = [ $expected, + $pluralizeSpace, $found, ]; @@ -766,15 +797,21 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array $phpcsFile->fixer->replaceToken(($indexPointer - 1), str_repeat(' ', $expected)); } } - } + }//end if $arrowStart = ($tokens[$indexPointer]['column'] + $maxLength + 1); if ($tokens[$index['arrow']]['column'] !== $arrowStart) { - $expected = ($arrowStart - ($index['index_length'] + $tokens[$indexPointer]['column'])); - $found = ($tokens[$index['arrow']]['column'] - ($index['index_length'] + $tokens[$indexPointer]['column'])); - $error = 'Array double arrow not aligned correctly; expected %s space(s) but found %s'; - $data = [ + $expected = ($arrowStart - ($index['index_length'] + $tokens[$indexPointer]['column'])); + $found = ($tokens[$index['arrow']]['column'] - ($index['index_length'] + $tokens[$indexPointer]['column'])); + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array double arrow not aligned correctly; expected %s space%s but found %s'; + $data = [ $expected, + $pluralizeSpace, $found, ]; @@ -788,7 +825,7 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array } continue; - } + }//end if $valueStart = ($arrowStart + 3); if ($tokens[$valuePointer]['column'] !== $valueStart) { @@ -798,9 +835,15 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array $found = 'newline'; } - $error = 'Array value not aligned correctly; expected %s space(s) but found %s'; + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array value not aligned correctly; expected %s space%s but found %s'; $data = [ $expected, + $pluralizeSpace, $found, ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php index a9a55fa8..fb147582 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class ClassDefinitionClosingBraceSpaceSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php index 4b7efd99..7ed872fe 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class ClassDefinitionNameSpacingSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php index e56dad73..0b84fa62 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class ClassDefinitionOpeningBraceSpaceSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php index 8548a721..07b60886 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class ColonSpacingSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php index 6b071ea7..0f9131e7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -26,7 +26,7 @@ class ColourDefinitionSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php index def95c1e..ddea3140 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -18,7 +18,7 @@ class DisallowMultipleStyleDefinitionsSniff implements Sniff /** * A list of tokenizers this sniff supports. * - * @var array + * @var string[] */ public $supportedTokenizers = ['CSS']; @@ -26,7 +26,7 @@ class DisallowMultipleStyleDefinitionsSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php index d489cb1b..9f51b524 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php index c7479759..97ad572c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -26,7 +26,7 @@ class DuplicateStyleDefinitionSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php index d3bb9696..e641ed20 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class EmptyClassDefinitionSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php index 05f2e515..816bb9b7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class EmptyStyleDefinitionSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php index d8585dc8..183afdbf 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php index 5e35f4e9..a0f0a9bd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php index c80a639c..509e9866 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -26,7 +26,7 @@ class LowercaseStyleDefinitionSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php index dbf7d6c9..a9ca371c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -26,7 +26,7 @@ class MissingColonSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php index 0a51f501..4d599e1b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php index 1dfbcf67..e2a3e8dd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class OpacitySniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php index fdc168e2..ef9d238c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -27,7 +27,7 @@ class SemicolonSpacingSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php index 8f2d9aa8..b59c2796 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; @@ -41,7 +41,7 @@ class ShorthandSizeSniff implements Sniff /** * Returns the token types that this sniff is interested in. * - * @return int[] + * @return array */ public function register() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php index 3d2c4db1..3f5e1fbc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; @@ -65,6 +65,7 @@ public function processOpen(File $phpcsFile, $stackPtr) if ($tokens[($stackPtr - 2)]['code'] !== T_ABSTRACT && $tokens[($stackPtr - 2)]['code'] !== T_FINAL + && $tokens[($stackPtr - 2)]['code'] !== T_READONLY ) { if ($spaces !== 0) { $type = strtolower($tokens[$stackPtr]['content']); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php index 88a7e0da..681b5e19 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php index a632f81e..1638d1f1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php index 5f4f78c0..1842eea1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; @@ -29,6 +29,7 @@ public function register() $targets[] = T_IMPLEMENTS; $targets[] = T_ABSTRACT; $targets[] = T_FINAL; + $targets[] = T_READONLY; $targets[] = T_VAR; $targets[] = T_CONST; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php index d17ca44c..407d3dae 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php @@ -9,7 +9,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php index ffddd2cd..0f019d35 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php index eb647f5f..81d85805 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php index 0da4ef24..4c4d3bad 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php @@ -12,14 +12,13 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; class ClassCommentSniff implements Sniff { @@ -49,8 +48,12 @@ public function register() public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - $find = Tokens::$methodPrefixes; - $find[T_WHITESPACE] = T_WHITESPACE; + $find = [ + T_ABSTRACT => T_ABSTRACT, + T_FINAL => T_FINAL, + T_READONLY => T_READONLY, + T_WHITESPACE => T_WHITESPACE, + ]; $previousContent = null; for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php index cd509d0c..dc4921bc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php index 1f49d2c0..7259e533 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; @@ -112,9 +112,15 @@ public function process(File $phpcsFile, $stackPtr) } if ($tokens[$i]['column'] !== $requiredColumn) { - $error = 'Expected %s space(s) before asterisk; %s found'; + $pluralizeSpace = 's'; + if (($requiredColumn - 1) === 1) { + $pluralizeSpace = ''; + } + + $error = 'Expected %s space%s before asterisk; %s found'; $data = [ ($requiredColumn - 1), + $pluralizeSpace, ($tokens[$i]['column'] - 1), ]; $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data); @@ -126,7 +132,7 @@ public function process(File $phpcsFile, $stackPtr) $phpcsFile->fixer->replaceToken(($i - 1), $padding); } } - } + }//end if if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR) { continue; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php index 4fc25219..2ec8add0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php index 08aaae29..ec31e4f6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; @@ -104,6 +104,7 @@ public function process(File $phpcsFile, $stackPtr) T_FINAL, T_STATIC, T_ABSTRACT, + T_READONLY, T_CONST, T_PROPERTY, T_INCLUDE, diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php index ba3e1710..644fd50c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; @@ -27,7 +27,7 @@ class FunctionCommentSniff extends PEARFunctionCommentSniff /** * The current PHP version. * - * @var integer + * @var integer|string|null */ private $phpVersion = null; @@ -143,9 +143,12 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) } } }//end if - } else if ($returnType !== 'mixed' && in_array('void', $typeNames, true) === false) { - // If return type is not void, there needs to be a return statement - // somewhere in the function that returns something. + } else if ($returnType !== 'mixed' + && $returnType !== 'never' + && in_array('void', $typeNames, true) === false + ) { + // If return type is not void, never, or mixed, there needs to be a + // return statement somewhere in the function that returns something. if (isset($tokens[$stackPtr]['scope_closer']) === true) { $endToken = $tokens[$stackPtr]['scope_closer']; for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) { @@ -405,6 +408,10 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) $suggestedTypeNames = []; foreach ($typeNames as $typeName) { + if ($typeName === '') { + continue; + } + // Strip nullable operator. if ($typeName[0] === '?') { $typeName = substr($typeName, 1); @@ -551,16 +558,38 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) // Make sure the param name is correct. if (isset($realParams[$pos]) === true) { - $realName = $realParams[$pos]['name']; - if ($realName !== $param['var']) { + $realName = $realParams[$pos]['name']; + $paramVarName = $param['var']; + + if ($param['var'][0] === '&') { + // Even when passed by reference, the variable name in $realParams does not have + // a leading '&'. This sniff will accept both '&$var' and '$var' in these cases. + $paramVarName = substr($param['var'], 1); + + // This makes sure that the 'MissingParamTag' check won't throw a false positive. + $foundParams[(count($foundParams) - 1)] = $paramVarName; + + if ($realParams[$pos]['pass_by_reference'] !== true && $realName === $paramVarName) { + // Don't complain about this unless the param name is otherwise correct. + $error = 'Doc comment for parameter %s is prefixed with "&" but parameter is not passed by reference'; + $code = 'ParamNameUnexpectedAmpersandPrefix'; + $data = [$paramVarName]; + + // We're not offering an auto-fix here because we can't tell if the docblock + // is wrong, or the parameter should be passed by reference. + $phpcsFile->addError($error, $param['tag'], $code, $data); + } + } + + if ($realName !== $paramVarName) { $code = 'ParamNameNoMatch'; $data = [ - $param['var'], + $paramVarName, $realName, ]; $error = 'Doc comment for parameter %s does not match '; - if (strtolower($param['var']) === strtolower($realName)) { + if (strtolower($paramVarName) === strtolower($realName)) { $error .= 'case of '; $code = 'ParamNameNoCaseMatch'; } @@ -568,7 +597,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) $error .= 'actual variable name %s'; $phpcsFile->addError($error, $param['tag'], $code, $data); - } + }//end if } else if (substr($param['var'], -4) !== ',...') { // We must have an extra parameter comment. $error = 'Superfluous parameter comment'; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php index a168bfe6..33c558cf 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php index 8ce95041..babe2edc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; @@ -49,7 +49,7 @@ public function register() * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * - * @return void + * @return void|int */ public function process(File $phpcsFile, $stackPtr) { @@ -83,6 +83,7 @@ public function process(File $phpcsFile, $stackPtr) T_FINAL, T_STATIC, T_ABSTRACT, + T_READONLY, T_CONST, T_PROPERTY, T_INCLUDE, diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php index 103d90ff..33bd8e6c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php index ce19d5c1..28cb7430 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php index 32e89789..d2d53e2c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php index 8a56b23f..bb539236 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; @@ -105,9 +105,15 @@ public function process(File $phpcsFile, $stackPtr) } if ($found !== $expected) { - $error = 'Expected %s space(s) after %s keyword; %s found'; + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Expected %s space%s after %s keyword; %s found'; $data = [ $expected, + $pluralizeSpace, strtoupper($tokens[$stackPtr]['content']), $found, ]; @@ -120,7 +126,7 @@ public function process(File $phpcsFile, $stackPtr) $phpcsFile->fixer->replaceToken(($stackPtr + 1), str_repeat(' ', $expected)); } } - } + }//end if // Single space after closing parenthesis. if (isset($tokens[$stackPtr]['parenthesis_closer']) === true @@ -146,9 +152,15 @@ public function process(File $phpcsFile, $stackPtr) } if ($found !== $expected) { - $error = 'Expected %s space(s) after closing parenthesis; found %s'; + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Expected %s space%s after closing parenthesis; found %s'; $data = [ $expected, + $pluralizeSpace, $found, ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php index 8abb8fb3..580f053c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php index c5f22e23..e0d22c3c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php index 370eab18..1c6ffe3d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php index 28443794..c8501116 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php index cba07684..10d76cd4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php index a5f3769d..a5bd11fc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php index 49dfc2c4..67cac550 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; @@ -44,7 +44,7 @@ public function register() * @param int $stackPtr The position in the stack where * the token was found. * - * @return void + * @return int * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run */ public function process(File $phpcsFile, $stackPtr) @@ -52,7 +52,7 @@ public function process(File $phpcsFile, $stackPtr) $rhinoPath = Config::getExecutablePath('rhino'); $jslintPath = Config::getExecutablePath('jslint'); if ($rhinoPath === null || $jslintPath === null) { - return; + return ($phpcsFile->numTokens + 1); } $fileName = $phpcsFile->getFilename(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php index 30dca672..8f9989ed 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; @@ -45,14 +45,14 @@ public function register() * @param int $stackPtr The position in the stack where * the token was found. * - * @return void + * @return int * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If Javascript Lint ran into trouble. */ public function process(File $phpcsFile, $stackPtr) { $jslPath = Config::getExecutablePath('jsl'); if ($jslPath === null) { - return; + return ($phpcsFile->numTokens + 1); } $fileName = $phpcsFile->getFilename(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php index 6277b809..4069a22e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php index 8becb74a..6e60aadd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php index e696d800..2c9e7c56 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php index 4b6a6acf..fdb391c2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php index f6fc383a..ecf06ac2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php index 24588a91..3ecb31e3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php index 2357960c..471c602e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php index c12bd0c4..626b330f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; @@ -37,7 +37,7 @@ class MultiLineFunctionDeclarationSniff extends PEARFunctionDeclarationSniff * @param array $tokens The stack of tokens that make up * the file. * - * @return void + * @return bool */ public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php index 878035e6..2450ba7f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php index 5c3a7493..79f9c4b2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php index c324e205..b8757c53 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php @@ -4,7 +4,7 @@ * * @author Sertan Danis * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php index 84facf05..5f43d1b7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php index 787d3fc8..7c943a8b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php index 85e9825f..c018142c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; @@ -44,7 +44,7 @@ class ComparisonOperatorUsageSniff implements Sniff /** * A list of invalid operators with their alternatives. * - * @var array + * @var array> */ private static $invalidOps = [ 'PHP' => [ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php index cb377845..af2a377e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php index f9ea6202..bc964b7e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php index 04d06338..87e5d3c8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php index 9d8077f5..99171bdb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php index 9eb21242..595afc53 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php index 60b0c370..9bd02637 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php index 4448d244..2598b448 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php index a0f1161c..1842ef87 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php index 9f86a179..56fce551 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php index ef11aa6c..22911d80 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php index 3162c14b..74539d93 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php index 024eff8a..a76fc73a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php index 67369cb2..6003dc18 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php index 4e3ee215..0d0b93f4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php @@ -4,13 +4,14 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; class InnerFunctionsSniff implements Sniff { @@ -41,21 +42,28 @@ public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - $function = $phpcsFile->getCondition($stackPtr, T_FUNCTION); - if ($function === false) { - // Not a nested function. + if (isset($tokens[$stackPtr]['conditions']) === false) { return; } - $class = $phpcsFile->getCondition($stackPtr, T_ANON_CLASS, false); - if ($class !== false && $class > $function) { - // Ignore methods in anon classes. - return; + $conditions = $tokens[$stackPtr]['conditions']; + $reversedConditions = array_reverse($conditions, true); + + $outerFuncToken = null; + foreach ($reversedConditions as $condToken => $condition) { + if ($condition === T_FUNCTION || $condition === T_CLOSURE) { + $outerFuncToken = $condToken; + break; + } + + if (\array_key_exists($condition, Tokens::$ooScopeTokens) === true) { + // Ignore methods in OOP structures defined within functions. + return; + } } - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_EQUAL) { - // Ignore closures. + if ($outerFuncToken === null) { + // Not a nested function. return; } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php index 519b7f6c..134db888 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; @@ -75,6 +75,11 @@ public function process(File $phpcsFile, $stackPtr) } // Make sure this is a function call or a use statement. + if (empty($tokens[$stackPtr]['nested_attributes']) === false) { + // Class instantiation in attribute, not function call. + return; + } + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($next === false) { // Not a function call. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php index 343d9b29..f4bffff7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; @@ -16,6 +16,22 @@ class NonExecutableCodeSniff implements Sniff { + /** + * Tokens for terminating expressions, which can be used inline. + * + * This is in contrast to terminating statements, which cannot be used inline + * and would result in a parse error (which is not the concern of this sniff). + * + * `throw` can be used as an expression since PHP 8.0. + * {@link https://wiki.php.net/rfc/throw_expression} + * + * @var array + */ + private $expressionTokens = [ + T_EXIT => T_EXIT, + T_THROW => T_THROW, + ]; + /** * Returns an array of tokens this test wants to listen for. @@ -49,42 +65,58 @@ public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - // If this token is preceded with an "or", it only relates to one line - // and should be ignored. For example: fopen() or die(). $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_LOGICAL_OR || $tokens[$prev]['code'] === T_BOOLEAN_OR) { - return; - } - // Check if this token is actually part of a one-line IF or ELSE statement. - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if ($tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - $i = $tokens[$i]['parenthesis_opener']; - continue; - } else if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; + // Tokens which can be used in inline expressions need special handling. + if (isset($this->expressionTokens[$tokens[$stackPtr]['code']]) === true) { + // If this token is preceded by a logical operator, it only relates to one line + // and should be ignored. For example: fopen() or die(). + // Note: There is one exception: throw expressions can not be used with xor. + if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === true + && ($tokens[$stackPtr]['code'] === T_THROW && $tokens[$prev]['code'] === T_LOGICAL_XOR) === false + ) { + return; } - break; - } + // Expressions are allowed in the `else` clause of ternaries. + if ($tokens[$prev]['code'] === T_INLINE_THEN || $tokens[$prev]['code'] === T_INLINE_ELSE) { + return; + } + + // Expressions are allowed with PHP 7.0+ null coalesce and PHP 7.4+ null coalesce equals. + if ($tokens[$prev]['code'] === T_COALESCE || $tokens[$prev]['code'] === T_COALESCE_EQUAL) { + return; + } - if ($tokens[$i]['code'] === T_IF - || $tokens[$i]['code'] === T_ELSE - || $tokens[$i]['code'] === T_ELSEIF + // Expressions are allowed in arrow functions. + if ($tokens[$prev]['code'] === T_FN_ARROW) { + return; + } + }//end if + + // This token may be part of an inline condition. + // If we find a closing parenthesis that belongs to a condition, + // or an "else", we should ignore this token. + if ($tokens[$prev]['code'] === T_ELSE + || (isset($tokens[$prev]['parenthesis_owner']) === true + && ($tokens[$tokens[$prev]['parenthesis_owner']]['code'] === T_IF + || $tokens[$tokens[$prev]['parenthesis_owner']]['code'] === T_ELSEIF)) ) { return; } if ($tokens[$stackPtr]['code'] === T_RETURN) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($tokens[$next]['code'] === T_SEMICOLON) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { // If this is the closing brace of a function // then this return statement doesn't return anything // and is not required anyway. $owner = $tokens[$next]['scope_condition']; - if ($tokens[$owner]['code'] === T_FUNCTION) { + if ($tokens[$owner]['code'] === T_FUNCTION + || $tokens[$owner]['code'] === T_CLOSURE + ) { $warning = 'Empty return statement not required here'; $phpcsFile->addWarning($warning, $stackPtr, 'ReturnNotRequired'); return; @@ -136,22 +168,6 @@ public function process(File $phpcsFile, $stackPtr) }//end if }//end if - // This token may be part of an inline condition. - // If we find a closing parenthesis that belongs to a condition - // we should ignore this token. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset($tokens[$prev]['parenthesis_owner']) === true) { - $owner = $tokens[$prev]['parenthesis_owner']; - $ignore = [ - T_IF => true, - T_ELSE => true, - T_ELSEIF => true, - ]; - if (isset($ignore[$tokens[$owner]['code']]) === true) { - return; - } - } - $ourConditions = array_keys($tokens[$stackPtr]['conditions']); if (empty($ourConditions) === false) { @@ -204,8 +220,8 @@ public function process(File $phpcsFile, $stackPtr) $end = ($phpcsFile->numTokens - 1); }//end if - // Find the semicolon that ends this statement, skipping - // nested statements like FOR loops and closures. + // Find the semicolon or closing PHP tag that ends this statement, + // skipping nested statements like FOR loops and closures. for ($start = ($stackPtr + 1); $start < $phpcsFile->numTokens; $start++) { if ($start === $end) { break; @@ -225,7 +241,7 @@ public function process(File $phpcsFile, $stackPtr) continue; } - if ($tokens[$start]['code'] === T_SEMICOLON) { + if ($tokens[$start]['code'] === T_SEMICOLON || $tokens[$start]['code'] === T_CLOSE_TAG) { break; } }//end for @@ -258,6 +274,16 @@ public function process(File $phpcsFile, $stackPtr) continue; } + // Skip HTML whitespace. + if ($tokens[$i]['code'] === T_INLINE_HTML && \trim($tokens[$i]['content']) === '') { + continue; + } + + // Skip PHP re-open tag (eg, after inline HTML). + if ($tokens[$i]['code'] === T_OPEN_TAG) { + continue; + } + $line = $tokens[$i]['line']; if ($line > $lastLine) { $type = substr($tokens[$stackPtr]['type'], 2); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php index 5239b644..3d1c83f0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php index 8a34a4f2..39ed5b0d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php index f3b5495d..aab5bdb7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php index 9d32e54a..99b935ed 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php index 1ff99b9c..d08bc3d1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; @@ -38,7 +38,7 @@ public function register() * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php index 512d878a..2bf1b053 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php index 95f95ed6..8162f488 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php index 808888f4..1500b576 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php index 68871990..83b4a4de 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php index 09c5a48a..dc9f32e9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php index 1f4704b9..dc99d73f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; @@ -262,22 +262,21 @@ public function process(File $phpcsFile, $stackPtr) $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['comment_opener'] - 1), null, true); } - $prevLineToken = $prevContent; - // Before we throw an error, check that we are not throwing an error // for another function. We don't want to error for no blank lines after // the previous function and no blank lines before this one as well. - $prevLine = ($tokens[$prevContent]['line'] - 1); - $i = ($stackPtr - 1); - $foundLines = 0; - $stopAt = 0; - if (isset($tokens[$stackPtr]['conditions']) === true) { - $conditions = $tokens[$stackPtr]['conditions']; + if (isset($tokens[$prevLineToken]['conditions']) === true) { + $conditions = $tokens[$prevLineToken]['conditions']; $conditions = array_keys($conditions); $stopAt = array_pop($conditions); } + $prevLineToken = $prevContent; + $prevLine = ($tokens[$prevContent]['line'] - 1); + $i = ($stackPtr - 1); + $foundLines = 0; + while ($currentLine !== $prevLine && $currentLine > 1 && $i > $stopAt) { if ($tokens[$i]['code'] === T_FUNCTION) { // Found another interface or abstract function. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php index c1492bf7..c6fe537f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php index a89a02a9..2d84b388 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php index 0ece1aca..da149cae 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; @@ -212,8 +212,6 @@ protected function processMemberVar(File $phpcsFile, $stackPtr) return $endOfStatement; } - return; - }//end processMemberVar() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php index cc5db164..1c1f80c5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php index f1e2fce6..aeeb3665 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php index 198460df..b21660c4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php index fd038753..5251bce8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php index 2d800f05..1424819f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php index bdcf9a5d..a1aa6c5e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php index e99d829b..bc24f997 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php @@ -8,7 +8,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php index 304a0d42..ad74ac3f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc index 2774660c..5b539a37 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc @@ -475,14 +475,63 @@ yield array( static fn () : string => '', ); -$foo = [ +$foo = array( 'foo' => match ($anything) { 'foo' => 'bar', default => null, }, - ]; + ); // Intentional syntax error. $a = array( 'a' => ); + +// Safeguard correct errors for key/no key when PHP 7.4+ array unpacking is encountered. +$x = array( + ...$a, + 'foo' => 'bar', + ); + +$x = array( + 'foo' => 'bar', + ...$a, + ); + +$x = array( + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + ); + +$x = array( + ...$a, + 'foo' => 'bar', // OK. + 'bar', // NoKeySpecified Error (based on second entry). + ); + +$x = array( + ...$a, + 'bar', // OK. + 'foo' => 'bar', // KeySpecified Error (based on second entry). + ); + +$x = array( + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + 'bar', // NoKeySpecified Error (based on first entry). + ); + +$x = array( + 'bar', + ...$a, + 'bar', + 'baz' => 'bar', // KeySpecified (based on first entry). + ); + + $x = + array( + 'a', + 'b', + ); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed index b4520064..5ebf7150 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed @@ -511,14 +511,63 @@ yield array( static fn () : string => '', ); -$foo = [ +$foo = array( 'foo' => match ($anything) { 'foo' => 'bar', default => null, }, - ]; + ); // Intentional syntax error. $a = array( 'a' => ); + +// Safeguard correct errors for key/no key when PHP 7.4+ array unpacking is encountered. +$x = array( + ...$a, + 'foo' => 'bar', + ); + +$x = array( + 'foo' => 'bar', + ...$a, + ); + +$x = array( + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + ); + +$x = array( + ...$a, + 'foo' => 'bar', // OK. + 'bar', // NoKeySpecified Error (based on second entry). + ); + +$x = array( + ...$a, + 'bar', // OK. + 'foo' => 'bar', // KeySpecified Error (based on second entry). + ); + +$x = array( + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + 'bar', // NoKeySpecified Error (based on first entry). + ); + +$x = array( + 'bar', + ...$a, + 'bar', + 'baz' => 'bar', // KeySpecified (based on first entry). + ); + + $x = + array( + 'a', + 'b', + ); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc index 621970fa..7bcc5e04 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc @@ -464,7 +464,63 @@ yield [ static fn () : string => '', ]; +$foo = [ + 'foo' => match ($anything) { + 'foo' => 'bar', + default => null, + }, + ]; + // Intentional syntax error. $a = [ 'a' => ]; + +// Safeguard correct errors for key/no key when PHP 7.4+ array unpacking is encountered. +$x = [ + ...$a, + 'foo' => 'bar', + ]; + +$x = [ + 'foo' => 'bar', + ...$a, + ]; + +$x = [ + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + ]; + +$x = [ + ...$a, + 'foo' => 'bar', // OK. + 'bar', // NoKeySpecified Error (based on second entry). + ]; + +$x = [ + ...$a, + 'bar', // OK. + 'foo' => 'bar', // KeySpecified Error (based on second entry). + ]; + +$x = [ + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + 'bar', // NoKeySpecified Error (based on first entry). + ]; + +$x = [ + 'bar', + ...$a, + 'bar', + 'baz' => 'bar', // KeySpecified (based on first entry). + ]; + + $x = + [ + 'a', + 'b', + ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed index efe4c450..d156357c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed @@ -498,7 +498,63 @@ yield [ static fn () : string => '', ]; +$foo = [ + 'foo' => match ($anything) { + 'foo' => 'bar', + default => null, + }, + ]; + // Intentional syntax error. $a = [ 'a' => ]; + +// Safeguard correct errors for key/no key when PHP 7.4+ array unpacking is encountered. +$x = [ + ...$a, + 'foo' => 'bar', + ]; + +$x = [ + 'foo' => 'bar', + ...$a, + ]; + +$x = [ + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + ]; + +$x = [ + ...$a, + 'foo' => 'bar', // OK. + 'bar', // NoKeySpecified Error (based on second entry). + ]; + +$x = [ + ...$a, + 'bar', // OK. + 'foo' => 'bar', // KeySpecified Error (based on second entry). + ]; + +$x = [ + 'foo' => 'bar', + ...$a, + 'baz' => 'bar', + 'bar', // NoKeySpecified Error (based on first entry). + ]; + +$x = [ + 'bar', + ...$a, + 'bar', + 'baz' => 'bar', // KeySpecified (based on first entry). + ]; + + $x = + [ + 'a', + 'b', + ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php index 15ce0746..e4eb4f3b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; @@ -124,6 +124,11 @@ public function getErrorList($testFile='') 467 => 1, 471 => 1, 472 => 1, + 510 => 1, + 516 => 1, + 523 => 1, + 530 => 1, + 537 => 1, ]; case 'ArrayDeclarationUnitTest.2.inc': return [ @@ -210,6 +215,11 @@ public function getErrorList($testFile='') 456 => 1, 460 => 1, 461 => 1, + 499 => 1, + 505 => 1, + 512 => 1, + 519 => 1, + 526 => 1, ]; default: return []; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php index 528fcfd6..da5ca616 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php index 41202bc8..db3cfa89 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php index d1e44219..69698b14 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php index 9b8aa103..a7b0307d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php index d535fdc2..50b6a82b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php index 8e3b4873..56070b62 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php index 2a95971b..4361c18e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php index c555461b..7c430b27 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php index b3fd318c..7efde6b5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php index f5bc858d..5118d1b5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php index 28aa8ec3..1857f6c6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php index 9413b4ff..2fa963f3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php index 1a25aaac..1c6e86f0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php index dc0809e2..e1b07f24 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php index a8032fad..bd880a51 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php index 9fe839da..bde499d6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php index 897df65e..980fd969 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php index 3d0baaad..4b92b219 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc index 43ef6c9c..2af42d37 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc @@ -119,3 +119,12 @@ class IncorrectCodeBeforeClosingBrace { echo phpinfo();} + +readonly +class Test +{ +} + +readonly class Test +{ +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc.fixed index 9083633f..5d01b68e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc.fixed @@ -130,3 +130,11 @@ class IncorrectCodeBeforeClosingBrace echo phpinfo(); } + +readonly class Test +{ +} + +readonly class Test +{ +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.php index 914e6c87..f4698e74 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; @@ -61,6 +61,8 @@ public function getErrorList() 116 => 1, 118 => 1, 121 => 1, + 124 => 2, + 128 => 2, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php index 5964d2b1..2a2c2a63 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php index 1b71eb2c..f887aaec 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc index ea8cd89e..eb724505 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc @@ -5,7 +5,7 @@ Interface MyInterface {} Trait MyTrait {} Enum MyEnum IMPLEMENTS Colorful {} -class MyClass +ReadOnly class MyClass { Var $myVar = null; Const myConst = true; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed index f5739052..672fdfb3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed @@ -5,7 +5,7 @@ interface MyInterface {} trait MyTrait {} enum MyEnum implements Colorful {} -class MyClass +readonly class MyClass { var $myVar = null; const myConst = true; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php index 8c4d10c7..de07e252 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; @@ -31,6 +31,7 @@ public function getErrorList() 4 => 1, 5 => 1, 6 => 2, + 8 => 1, 10 => 1, 11 => 1, 14 => 1, diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php index ea493d3c..63829e36 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php index b7de260b..2257638a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.php index c8a360e2..aaa1b882 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc index 28aff226..8de3d0a7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc @@ -131,3 +131,15 @@ class Space_At_end class AllGood { } + +/** + * Docblock + */ +abstract readonly class AbstractReadonlyWithDocblock {} + +/* + * Docblock + */ +readonly class ReadonlyWrongStyle {} + +readonly final class ReadonlyFinalWithoutDocblock {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.php index 80a404be..ed64d93b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; @@ -26,10 +26,12 @@ class ClassCommentUnitTest extends AbstractSniffUnitTest public function getErrorList() { return [ - 2 => 1, - 15 => 1, - 31 => 1, - 54 => 1, + 2 => 1, + 15 => 1, + 31 => 1, + 54 => 1, + 143 => 1, + 145 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php index 6f5166ec..7e44a01c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc index e42cf8ab..d95acd2c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc @@ -31,7 +31,7 @@ class MyClass * Some info about the class here * */ -class MyClass +readonly class MyClass { /** * Some info about the function here. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed index 6182b539..ea6488a0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed @@ -31,7 +31,7 @@ class MyClass * Some info about the class here * */ -class MyClass +readonly class MyClass { /** * Some info about the function here. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php index acbf13e8..8ff7ec5e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php index 3c1668e4..d53429e0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc new file mode 100644 index 00000000..1f82abfe --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc @@ -0,0 +1,12 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ + +readonly class Foo { +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php index ee81369a..6e6ad1a0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; @@ -46,6 +46,7 @@ public function getErrorList($testFile='FileCommentUnitTest.inc') case 'FileCommentUnitTest.6.inc': case 'FileCommentUnitTest.7.inc': case 'FileCommentUnitTest.9.inc': + case 'FileCommentUnitTest.10.inc': return [1 => 1]; case 'FileCommentUnitTest.5.inc': diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php index 1e2d07fa..8b54e400 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc index 4f59f60b..a44f5e0e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc @@ -1046,3 +1046,91 @@ public function ignored() { * @return void * @throws Exception If any other error occurs. */ function throwCommentOneLine() {} + +/** + * When two adjacent pipe symbols are used (by mistake), the sniff should not throw a PHP Fatal error + * + * @param stdClass||null $object While invalid, this should not throw a PHP Fatal error. + * @return void + */ +function doublePipeFatalError(?stdClass $object) {} + +/** + * Test for passing variables by reference + * + * This sniff treats the '&' as optional for parameters passed by reference, but + * forbidden for parameters which are not passed by reference. + * + * Because mismatches may be in either direction, we cannot auto-fix these. + * + * @param string $foo A string passed in by reference. + * @param string &$bar A string passed in by reference. + * @param string $baz A string NOT passed in by reference. + * @param string &$qux A string NOT passed in by reference. + * @param string &$case1 A string passed in by reference with a case mismatch. + * @param string &$CASE2 A string NOT passed in by reference, also with a case mismatch. + * + * @return void + */ +public function variablesPassedByReference(&$foo, &$bar, $baz, $qux, &$CASE1, $case2) +{ + return; +} + +/** + * Test for param tag containing ref, but param in declaration not being by ref. + * + * @param string &$foo This should be flagged as (only) ParamNameUnexpectedAmpersandPrefix. + * @param string &$bar This should be flagged as (only) ParamNameNoMatch. + * @param string &$baz This should be flagged as (only) ParamNameNoCaseMatch. + * + * @return void + */ +function passedByRefMismatch($foo, $bra, $BAZ) { + return; +} + +/** + * Test variable case + * + * @param string $foo This parameter is lowercase. + * @param string $BAR This parameter is UPPERCASE. + * @param string $BazQux This parameter is TitleCase. + * @param string $corgeGrault This parameter is camelCase. + * @param string $GARPLY This parameter should be in lowercase. + * @param string $waldo This parameter should be in TitleCase. + * @param string $freD This parameter should be in UPPERCASE. + * @param string $PLUGH This parameter should be in TitleCase. + * + * @return void + */ +public function variableCaseTest( + $foo, + $BAR, + $BazQux, + $corgeGrault, + $garply, + $Waldo, + $FRED, + $PluGh +) { + return; +} + +/** + * Test variable order mismatch + * + * @param string $foo This is the third parameter. + * @param string $bar This is the first parameter. + * @param string $baz This is the second parameter. + * + * @return void + */ +public function variableOrderMismatch($bar, $baz, $foo) { + return; +} + +/** + * @return never + */ +function foo() {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed index 21a4103e..3d2e10fd 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed @@ -1046,3 +1046,91 @@ public function ignored() { * @return void * @throws Exception If any other error occurs. */ function throwCommentOneLine() {} + +/** + * When two adjacent pipe symbols are used (by mistake), the sniff should not throw a PHP Fatal error + * + * @param stdClass|null $object While invalid, this should not throw a PHP Fatal error. + * @return void + */ +function doublePipeFatalError(?stdClass $object) {} + +/** + * Test for passing variables by reference + * + * This sniff treats the '&' as optional for parameters passed by reference, but + * forbidden for parameters which are not passed by reference. + * + * Because mismatches may be in either direction, we cannot auto-fix these. + * + * @param string $foo A string passed in by reference. + * @param string &$bar A string passed in by reference. + * @param string $baz A string NOT passed in by reference. + * @param string &$qux A string NOT passed in by reference. + * @param string &$case1 A string passed in by reference with a case mismatch. + * @param string &$CASE2 A string NOT passed in by reference, also with a case mismatch. + * + * @return void + */ +public function variablesPassedByReference(&$foo, &$bar, $baz, $qux, &$CASE1, $case2) +{ + return; +} + +/** + * Test for param tag containing ref, but param in declaration not being by ref. + * + * @param string &$foo This should be flagged as (only) ParamNameUnexpectedAmpersandPrefix. + * @param string &$bar This should be flagged as (only) ParamNameNoMatch. + * @param string &$baz This should be flagged as (only) ParamNameNoCaseMatch. + * + * @return void + */ +function passedByRefMismatch($foo, $bra, $BAZ) { + return; +} + +/** + * Test variable case + * + * @param string $foo This parameter is lowercase. + * @param string $BAR This parameter is UPPERCASE. + * @param string $BazQux This parameter is TitleCase. + * @param string $corgeGrault This parameter is camelCase. + * @param string $GARPLY This parameter should be in lowercase. + * @param string $waldo This parameter should be in TitleCase. + * @param string $freD This parameter should be in UPPERCASE. + * @param string $PLUGH This parameter should be in TitleCase. + * + * @return void + */ +public function variableCaseTest( + $foo, + $BAR, + $BazQux, + $corgeGrault, + $garply, + $Waldo, + $FRED, + $PluGh +) { + return; +} + +/** + * Test variable order mismatch + * + * @param string $foo This is the third parameter. + * @param string $bar This is the first parameter. + * @param string $baz This is the second parameter. + * + * @return void + */ +public function variableOrderMismatch($bar, $baz, $foo) { + return; +} + +/** + * @return never + */ +function foo() {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php index 632b7c51..866b1e96 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; @@ -48,8 +48,7 @@ public function getErrorList() 138 => 4, 139 => 4, 143 => 2, - 152 => 1, - 155 => 2, + 155 => 1, 159 => 1, 166 => 1, 173 => 1, @@ -116,6 +115,23 @@ public function getErrorList() 1004 => 2, 1006 => 1, 1029 => 1, + 1053 => 1, + 1058 => 2, + 1069 => 1, + 1070 => 1, + 1071 => 1, + 1080 => 2, + 1083 => 1, + 1084 => 1, + 1085 => 1, + 1093 => 4, + 1100 => 1, + 1101 => 1, + 1102 => 1, + 1103 => 1, + 1123 => 1, + 1124 => 1, + 1125 => 1, ]; // Scalar type hints only work from PHP 7 onwards. @@ -131,12 +147,16 @@ public function getErrorList() $errors[575] = 2; $errors[627] = 1; $errors[1002] = 1; + $errors[1075] = 6; + $errors[1089] = 3; + $errors[1107] = 8; + $errors[1129] = 3; } else { $errors[729] = 4; $errors[740] = 2; $errors[752] = 2; $errors[982] = 1; - } + }//end if // Object type hints only work from PHP 7.2 onwards. if (PHP_VERSION_ID >= 70200) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc index 10a0b4b4..02487684 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc @@ -173,6 +173,19 @@ enum MyEnum { } +/** + * Comment should be ignored. + * + */ +readonly class MyClass +{ + /** + * Comment should be ignored. + * + */ + readonly $property = 10; +} + /* * N.B.: The below test line must be the last test in the file. * Testing that a new line after an inline comment when it's the last non-whitespace diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed index 97ae0149..949a9ff9 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed @@ -166,6 +166,19 @@ enum MyEnum { } +/** + * Comment should be ignored. + * + */ +readonly class MyClass +{ + /** + * Comment should be ignored. + * + */ + readonly $property = 10; +} + /* * N.B.: The below test line must be the last test in the file. * Testing that a new line after an inline comment when it's the last non-whitespace diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php index e4a5298b..04c3ed99 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php index 5b61612c..ad802217 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; @@ -60,7 +60,7 @@ public function getErrorList($testFile='LongConditionClosingCommentUnitTest.inc' 1008 => 1, 1032 => 1, ]; - break; + case 'LongConditionClosingCommentUnitTest.js': return [ 47 => 1, @@ -76,10 +76,9 @@ public function getErrorList($testFile='LongConditionClosingCommentUnitTest.inc' 439 => 1, 444 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php index a04426f1..5e4c97b8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php index 1af5e148..a83791c6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc index 8eaf1b03..6496f7fb 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc @@ -212,7 +212,7 @@ else : echo 'not 1'; endif; -// @codingStandardsChangeSetting Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 +// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 if ($a == 5): echo "a equals 5"; @@ -305,6 +305,20 @@ $r = match ($x) { $r = match($x){1 => 1}; +// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 2 +if ($a == 5): + echo "a equals 5"; + echo "..."; +elseif ($a == 6) : + echo "a equals 6"; + echo "!!!"; +else : + echo "a is neither 5 nor 6"; +endif; + +// Reset property. +// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 1 + // Intentional parse error. This should be the last test in the file. foreach // Some unrelated comment. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed index dc5233d9..c8834a3d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed @@ -215,7 +215,7 @@ else : echo 'not 1'; endif; -// @codingStandardsChangeSetting Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 +// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 if ($a == 5): echo "a equals 5"; @@ -309,6 +309,20 @@ $r = match ($x) { $r = match ($x) { 1 => 1}; +// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 2 +if ($a == 5) : + echo "a equals 5"; + echo "..."; +elseif ($a == 6) : + echo "a equals 6"; + echo "!!!"; +else : + echo "a is neither 5 nor 6"; +endif; + +// Reset property. +// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 1 + // Intentional parse error. This should be the last test in the file. foreach // Some unrelated comment. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php index 92427f0d..ce1323be 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; @@ -77,6 +77,8 @@ public function getErrorList($testFile='ControlSignatureUnitTest.inc') $errors[279] = 1; $errors[283] = 1; $errors[306] = 3; + $errors[309] = 1; + $errors[315] = 1; }//end if return $errors; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.php index f0d9210f..f119fe8d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php index 6957ff67..ccb77521 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php index 51638866..4aef1d7a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php index 97212dba..87d52fc4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.php index dc8a3ac6..b0085487 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php index c94c8333..4211345d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php index 7ccfe1a3..a0c45c15 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; @@ -19,7 +19,7 @@ class JSLintUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php index 1e83f1f4..30108f59 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; @@ -19,7 +19,7 @@ class JavaScriptLintUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php index 7e613b33..992f2622 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php index 4f04a6eb..ff1f7af5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Formatting; @@ -73,7 +73,7 @@ public function getErrorList($testFile='OperatorBracketUnitTest.inc') 193 => 1, 194 => 2, ]; - break; + case 'OperatorBracketUnitTest.js': return [ 5 => 1, @@ -90,10 +90,9 @@ public function getErrorList($testFile='OperatorBracketUnitTest.inc') 63 => 1, 108 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php index 65e987dd..9d97a2bf 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.php index a939a905..e53e9e7a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php index da09cef3..88568b79 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php index 7be76488..efea5445 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php index 1e1537b7..d2ad14b7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc index fce0b237..811c56ec 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc @@ -255,3 +255,50 @@ private string $private, ) { } } + +// PHP 8.1: new in initializers means that class instantiations with parameters can occur in a function declaration. +function usingNewInInitializersCallParamsIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA(), + new InjectedDependencyB + ) +) {} + +function usingNewInInitializersCallParamsNotIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA, + new InjectedDependencyB() + ) +) {} + +function usingNewInInitializersCallParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + int $paramA, + string $paramB, + object $paramC = new SomeClass( +new InjectedDependencyA(), new InjectedDependencyB() +) +) {} + +class UsingNewInInitializers { + public function doSomething( + object $paramA, + stdClass $paramB = new stdClass(), + Exception $paramC = new Exception( + new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } + + public function callParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + Exception $param = new Exception( +new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed index b927a001..c38e3ecc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed @@ -267,3 +267,50 @@ class ConstructorPropertyPromotionMultiLineDocblockAndAttributeIncorrectIndent ) { } } + +// PHP 8.1: new in initializers means that class instantiations with parameters can occur in a function declaration. +function usingNewInInitializersCallParamsIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA(), + new InjectedDependencyB + ) +) {} + +function usingNewInInitializersCallParamsNotIndented( + int $paramA, + string $paramB, + object $paramC = new SomeClass( + new InjectedDependencyA, + new InjectedDependencyB() + ) +) {} + +function usingNewInInitializersCallParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + int $paramA, + string $paramB, + object $paramC = new SomeClass( +new InjectedDependencyA(), new InjectedDependencyB() +) +) {} + +class UsingNewInInitializers { + public function doSomething( + object $paramA, + stdClass $paramB = new stdClass(), + Exception $paramC = new Exception( + new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } + + public function callParamsIncorrectlyIndentedShouldNotBeFlaggedNorFixed( + Exception $param = new Exception( +new ExceptionMessage(), + new ExceptionCode(), + ), + ) { + } +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php index 5208ad0c..ac8c1f99 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php index 77f13bb2..1a58cae1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php index 9acbe241..e69f2b7b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php index cb2d58e5..f98b1398 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php @@ -4,7 +4,7 @@ * * @author Sertan Danis * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc index 41c88128..725c60ed 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc @@ -41,6 +41,13 @@ function nonAssignmentTernary() { } } +// Test for tokenizer issue #3789. +$a = $b !== null + ? match ($c) { + default => 5, + } + : new Foo; + // Intentional parse error. This must be the last test in the file. function new ?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php index f9979fa2..8c82d0c3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php index ab1cf810..3b37ed55 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php index 5618a7fc..0cf59a1a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; @@ -59,7 +59,7 @@ public function getErrorList($testFile='ComparisonOperatorUsageUnitTest.inc') 131 => 1, 135 => 1, ]; - break; + case 'ComparisonOperatorUsageUnitTest.js': return [ 5 => 1, @@ -74,10 +74,9 @@ public function getErrorList($testFile='ComparisonOperatorUsageUnitTest.inc') 67 => 1, 71 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php index 3846905d..c77425d1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php index fc351319..ca38f9ed 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php index 36c556d8..f137bbab 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; @@ -58,16 +58,15 @@ public function getWarningList($testFile='CommentedOutCodeUnitTest.inc') 147 => 1, 158 => 1, ]; - break; + case 'CommentedOutCodeUnitTest.css': return [ 7 => 1, 16 => 1, ]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php index 6439b632..348bcd65 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php index c8d8b0b8..d4485b87 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php index 27083ce2..9041d9be 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; @@ -33,13 +33,12 @@ public function getErrorList($testFile='DisallowInlineIfUnitTest.inc') 8 => 1, 18 => 1, ]; - break; + case 'DisallowInlineIfUnitTest.js': return [1 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php index 618d76ef..ee4f958f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php index 21260ad7..0e037f07 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; @@ -43,13 +43,12 @@ public function getErrorList($testFile='DisallowSizeFunctionsInLoopsUnitTest.inc 44 => 1, 46 => 1, ]; - break; + case 'DisallowSizeFunctionsInLoopsUnitTest.js': return [1 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc index ca457a2e..3c875d09 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc @@ -2,4 +2,6 @@ error_log('test'); print_r($array); var_dump($array); -?> + +#[Var_Dump(10)] +function debugMe() {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php index 2b2ff5b4..077c896e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php index f8cf4cc7..ef825be4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php index adee7882..bfeb595c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php index 52f6a00a..1a9f1d0e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php index 2f06f0b0..326d3cad 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc index dd851461..d16c7f2e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc @@ -48,3 +48,40 @@ new class { } } }; + +$outerClosure = function () +{ + // Functions inside closures are not allowed. + function innerFunction() { + } +}; + +// Allow methods in classes/traits/interfaces defined inside functions +function foo() { + if (class_exists('MyClass') === false) { + class MyClass { + function foo() {} + } + } + + if (trait_exists('MyTrait') === false) { + trait MyTrait { + function foo() {} + } + } + + if (interface_exists('MyInterface') === false) { + interface MyInterface { + function foo(); + } + } + + // But disallow functions nested inside those methods + if (class_exists('NestedFunctionInMethod') === false) { + class NestedFunctionInMethod { + function foo() { + function innerFunction() {} + } + } + } +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.php index 3c9ad07b..cd3a49d3 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; @@ -28,6 +28,8 @@ public function getErrorList() return [ 5 => 1, 46 => 1, + 55 => 1, + 83 => 1, ]; }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc index c67381ad..702b13de 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc @@ -41,3 +41,10 @@ $callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be $filePath = new \File($path); $count = $object?->Count(); + +class AttributesShouldBeIgnored +{ + #[Putenv('FOO', 'foo')] + public function foo(): void + {} +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed index 40507c04..281425c5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed @@ -41,3 +41,10 @@ $callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be $filePath = new \File($path); $count = $object?->Count(); + +class AttributesShouldBeIgnored +{ + #[Putenv('FOO', 'foo')] + public function foo(): void + {} +} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php index 708d01ef..83460f2b 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc index ed7f0115..2efcc78e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc @@ -297,5 +297,127 @@ class TestAlternativeControlStructures { $var_after_class_in_global_space = 1; do_something_else(); +// These are parse errors, but that's not the concern of the sniff. +function parseError1() { + defined('FOO') or return 'foo'; + echo 'unreachable'; +} + +function parseError2() { + defined('FOO') || continue; + echo 'unreachable'; +} + +// All logical operators are allowed with inline expressions (but this was not correctly handled by the sniff). +function exitExpressionsWithLogicalOperators() { + $condition = false; + $condition || exit(); + $condition or die(); + + $condition = true; + $condition && die(); + $condition and exit; + + $condition xor die(); + + echo 'still executable as exit, in all of the above cases, is used as part of an expression'; +} + +// Inline expressions are allowed in ternaries. +function exitExpressionsInTernary() { + $value = $myValue ? $myValue : exit(); + $value = $myValue ?: exit(); + $value = $var == 'foo' ? 'bar' : die( 'world' ); + + $value = (!$myValue ) ? exit() : $myValue; + $value = $var != 'foo' ? die( 'world' ) : 'bar'; + + echo 'still executable'; +} + +// Inline expressions are allowed with null coalesce and null coalesce equals. +function exitExpressionsWithNullCoalesce() { + $value = $nullableValue ?? exit(); + $value ??= die(); + echo 'still executable'; +} + +// Inline expressions are allowed in arrow functions. +function exitExpressionsInArrowFunction() { + $callable = fn() => die(); + echo 'still executable'; +} + +// PHP 8.0+: throw expressions which don't stop execution. +function nonStoppingThrowExpressions() { + $callable = fn() => throw new Exception(); + + $value = $myValue ? 'something' : throw new Exception(); + $value = $myValue ?: throw new Exception(); + $value = $myValue ? throw new Exception() : 'something'; + + $value = $nullableValue ?? throw new Exception(); + $value ??= throw new Exception(); + + $condition && throw new Exception(); + $condition || throw new Exception(); + $condition and throw new Exception(); + $condition or throw new Exception(); + + echo 'still executable as throw, in all of the above cases, is used as part of an expression'; + + throw new Exception(); + echo 'non-executable'; +} + +// PHP 8.0+: throw expressions which do stop execution. +function executionStoppingThrowExpressionsA() { + $condition xor throw new Exception(); + echo 'non-executable'; +} + +function executionStoppingThrowExpressionsB() { + throw $userIsAuthorized ? new ForbiddenException() : new UnauthorizedException(); + echo 'non-executable'; +} + +function executionStoppingThrowExpressionsC() { + throw $condition1 && $condition2 ? new Exception1() : new Exception2(); + echo 'non-executable'; +} + +function executionStoppingThrowExpressionsD() { + throw $exception ??= new Exception(); + echo 'non-executable'; +} + +function executionStoppingThrowExpressionsE() { + throw $maybeNullException ?? new Exception(); + echo 'non-executable'; +} + +function returnNotRequiredIgnoreCommentsA() +{ + if ($something === TRUE) { + return /*comment*/; + } + + echo 'foo'; + return /*comment*/; +} + +function returnNotRequiredIgnoreCommentsB() +{ + echo 'foo'; + return; + /*comment*/ +} + +$closure = function () +{ + echo 'foo'; + return; // This return should be flagged as not required. +}; + // Intentional syntax error. return array_map( diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc index c9bf052f..9b7a22bc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc @@ -58,4 +58,16 @@ $a = new class { } }; +// Multiple statements are still one line of unreachable code, so should get +// only one complaint from this sniff. (Well, technically two here since there +// are two 'exit()' statements above, so one complaint from each of those. So, +// two here, but not six.) +echo 'one'; echo 'two'; echo 'three'; + +// A single statement split across multiple lines. Here we get complaints for +// each line, even though they're all part of one statement. +echo 'one' . 'two' + . 'three' . 'four' + . 'five' . 'six'; + interface MyInterface { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc new file mode 100644 index 00000000..6fe5c16c --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
non-executable
+ + + + + + + + +
non-executable
+ + + + + + + + +
non-executable
+ + + + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php index f5f90c0b..30ccad4d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; @@ -74,8 +74,19 @@ public function getWarningList($testFile='') 252 => 1, 253 => 1, 254 => 2, + 303 => 1, + 308 => 1, + 370 => 1, + 376 => 1, + 381 => 1, + 386 => 1, + 391 => 1, + 396 => 1, + 406 => 1, + 412 => 1, + 419 => 1, ]; - break; + case 'NonExecutableCodeUnitTest.2.inc': return [ 7 => 1, @@ -84,11 +95,22 @@ public function getWarningList($testFile='') 10 => 2, 14 => 1, 54 => 2, + 65 => 2, + 69 => 2, + 70 => 2, + 71 => 2, + ]; + + case 'NonExecutableCodeUnitTest.3.inc': + return [ + 27 => 1, + 36 => 1, + 45 => 1, + 54 => 1, + 62 => 1, ]; - break; default: return []; - break; }//end switch }//end getWarningList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php index 59e49910..7d94ba53 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.php index 4dc71779..cf99afb0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php index b1a5dd6a..076af551 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php index 862af7d2..9818c2c6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php index a95d1888..a0330eae 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php index 0d9af1e9..61d5db66 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.php index 48bc841f..f87eb7c8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php index ac3f5d6f..d3cc6e8d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; @@ -61,7 +61,7 @@ public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc') 261 => 1, 262 => 1, ]; - break; + case 'ControlStructureSpacingUnitTest.js': return [ 3 => 1, @@ -76,10 +76,9 @@ public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc') 74 => 2, 75 => 2, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php index 2e18f875..81d4aa12 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; @@ -37,7 +37,7 @@ public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc') 31 => 1, 39 => 1, ]; - break; + case 'FunctionClosingBraceSpaceUnitTest.js': return [ 13 => 1, @@ -49,10 +49,9 @@ public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc') 84 => 1, 128 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php index 438263eb..caef988e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc index 36a287f0..b03a0ed8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc @@ -574,3 +574,11 @@ class ClassWithAttributes { // phpcs:set Squiz.WhiteSpace.FunctionSpacing spacing 2 // phpcs:set Squiz.WhiteSpace.FunctionSpacing spacingBeforeFirst 2 // phpcs:set Squiz.WhiteSpace.FunctionSpacing spacingAfterLast 2 + +// Issue #3904. +echo 'this line belongs with the #3904 test'; +class Person {public function __construct($name){}} +echo 'this line belongs with the #3904 test'; + +function Foo() {} function bar($name){} +echo 'this line belongs with the #3904 test'; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc.fixed index ac2df1cb..443824ca 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc.fixed @@ -656,3 +656,18 @@ class ClassWithAttributes { // phpcs:set Squiz.WhiteSpace.FunctionSpacing spacing 2 // phpcs:set Squiz.WhiteSpace.FunctionSpacing spacingBeforeFirst 2 // phpcs:set Squiz.WhiteSpace.FunctionSpacing spacingAfterLast 2 + +// Issue #3904. +echo 'this line belongs with the #3904 test'; + + +class Person {public function __construct($name){}} + + +echo 'this line belongs with the #3904 test'; + + +function Foo() {} function bar($name){} + + +echo 'this line belongs with the #3904 test'; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.php index fabb6adb..307d481d 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; @@ -95,6 +95,8 @@ public function getErrorList($testFile='') 553 => 1, 560 => 1, 566 => 1, + 580 => 2, + 583 => 3, ]; case 'FunctionSpacingUnitTest.2.inc': diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php index 46b0d858..d8993959 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php index 62b74e36..9b71ceb1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php index 9b406681..3819a84e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php index 82a4056f..a9e8ebf6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc index 06462acc..765e7ab7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc @@ -269,7 +269,7 @@ fn&($x) => $x; // phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false $a = 3; - +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments true yield -1; echo -1; $a = -1; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed index 8b92a487..ada77fa8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed @@ -263,7 +263,7 @@ fn&($x) => $x; // phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false $a = 3; - +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments true yield -1; echo -1; $a = -1; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js index 16eb130f..f37df9d8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js @@ -101,3 +101,4 @@ var foo = bar.map(baz=> baz.length); // phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false a = 3; +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments true diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed index 877db467..47c89302 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed @@ -95,3 +95,4 @@ var foo = bar.map(baz => baz.length); // phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false a = 3; +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments true diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php index 8e8ad98d..d189e919 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; @@ -100,7 +100,7 @@ public function getErrorList($testFile='OperatorSpacingUnitTest.inc') 266 => 2, 271 => 2, ]; - break; + case 'OperatorSpacingUnitTest.js': return [ 4 => 1, @@ -143,10 +143,9 @@ public function getErrorList($testFile='OperatorSpacingUnitTest.inc') 100 => 1, 103 => 2, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php index e80f9367..a63070b0 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php index d659d647..087ac8a4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php index 30b66215..6862807c 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php index 72196f8e..97366343 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; @@ -43,7 +43,7 @@ public function getErrorList($testFile='SemicolonSpacingUnitTest.inc') 30 => 2, 36 => 1, ]; - break; + case 'SemicolonSpacingUnitTest.js': return [ 3 => 1, @@ -56,10 +56,9 @@ public function getErrorList($testFile='SemicolonSpacingUnitTest.inc') 22 => 1, 25 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css index 1dd1b6e6..e3f3f029 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css @@ -23,3 +23,10 @@ } /* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false */ +// /** +// * This text is in two types of comment: each line is commented out +// * individually, and the whole block is in what looks like a +// * docblock-comment. This sniff should ignore all this text as there +// * is no superfluous white-space here. +// */ + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed index 59ddddb0..11be21d5 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed @@ -21,3 +21,10 @@ float: left; } /* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false */ + +// /** +// * This text is in two types of comment: each line is commented out +// * individually, and the whole block is in what looks like a +// * docblock-comment. This sniff should ignore all this text as there +// * is no superfluous white-space here. +// */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php index b9ff96fb..f1621b9f 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; @@ -44,26 +44,26 @@ public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc') 65 => 1, 73 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.2.inc': return [ 2 => 1, 8 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.3.inc': return [ 6 => 1, 10 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.4.inc': case 'SuperfluousWhitespaceUnitTest.5.inc': return [ 1 => 1, 4 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.1.js': return [ 1 => 1, @@ -77,19 +77,18 @@ public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc') 38 => 1, 56 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.1.css': return [ 1 => 1, 8 => 1, 9 => 1, 11 => 1, - 25 => 1, + 32 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php index 5df4b0fc..5bcfdc0e 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php @@ -5,7 +5,7 @@ * @author Holger Kral * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Debug; @@ -46,7 +46,7 @@ public function process(File $phpcsFile, $stackPtr) { $analyzerPath = Config::getExecutablePath('zend_ca'); if ($analyzerPath === null) { - return; + return ($phpcsFile->numTokens + 1); } $fileName = $phpcsFile->getFilename(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php index 0ed34d13..b67dbf19 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Files; @@ -36,7 +36,7 @@ public function register() * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return int */ public function process(File $phpcsFile, $stackPtr) { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php index 267cd0ad..2dfeb39a 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php index efd3b900..9d90fb53 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Zend\Tests\Debug; @@ -19,7 +19,7 @@ class CodeAnalyzerUnitTest extends AbstractSniffUnitTest /** * Should this test be skipped for some reason. * - * @return void + * @return bool */ protected function shouldSkipTest() { diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.php index 4a42cde0..f13b78b6 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Zend\Tests\Files; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php index e57c7356..7ed046c8 100644 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Zend\Tests\NamingConventions; diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php index b7c2018b..d3f71b37 100644 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tokenizers; @@ -196,7 +196,11 @@ public function tokenize($string) // The first and last tokens are the open/close tags. array_shift($commentTokens); - array_pop($commentTokens); + $closeTag = array_pop($commentTokens); + + while ($closeTag['content'] !== '?'.'>') { + $closeTag = array_pop($commentTokens); + } if ($leadingZero === true) { $commentTokens[0]['content'] = substr($commentTokens[0]['content'], 1); diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php index beba53c2..9ca2ddf2 100644 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tokenizers; diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php index ee2f8429..cb7bd3c1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tokenizers; @@ -905,10 +905,10 @@ public function tokenize($string) * * If a regular expression is not found, NULL is returned. * - * @param string $char The index of the possible regex start character. + * @param int $char The index of the possible regex start character. * @param string $string The complete content of the string being tokenized. - * @param string $chars An array of characters being tokenized. - * @param string $tokens The current array of tokens found in the string. + * @param array $chars An array of characters being tokenized. + * @param array $tokens The current array of tokens found in the string. * * @return array|null */ diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php index 3fc67b0c..e8ad0db7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tokenizers; @@ -306,7 +306,7 @@ class PHP extends Tokenizer /** * Known lengths of tokens. * - * @var array + * @var array */ public $knownLengths = [ T_ABSTRACT => 8, @@ -681,6 +681,36 @@ protected function tokenize($string) } }//end if + /* + Special case for `static` used as a function name, i.e. `static()`. + */ + + if ($tokenIsArray === true + && $token[0] === T_STATIC + && $finalTokens[$lastNotEmptyToken]['code'] !== T_NEW + ) { + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === true + && isset(Util\Tokens::$emptyTokens[$tokens[$i][0]]) === true + ) { + continue; + } + + if ($tokens[$i][0] === '(') { + $finalTokens[$newStackPtr] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => $token[1], + ]; + + $newStackPtr++; + continue 2; + } + + break; + } + }//end if + /* Parse doc blocks into something that can be easily iterated over. */ @@ -750,6 +780,7 @@ protected function tokenize($string) && (isset($tokens[($stackPtr + 1)]) === true && is_array($tokens[($stackPtr + 1)]) === true && $tokens[($stackPtr + 1)][0] === T_STRING + && isset($tokens[($stackPtr + 1)][1][0], $tokens[($stackPtr + 1)][1][1]) === true && strtolower($tokens[($stackPtr + 1)][1][0]) === 'o' && $tokens[($stackPtr + 1)][1][1] !== '_') && preg_match('`^(o[0-7]+(?:_[0-7]+)?)([0-9_]*)$`i', $tokens[($stackPtr + 1)][1], $matches) === 1 @@ -1282,23 +1313,89 @@ protected function tokenize($string) "readonly" keyword for PHP < 8.1 */ - if (PHP_VERSION_ID < 80100 - && $tokenIsArray === true + if ($tokenIsArray === true && strtolower($token[1]) === 'readonly' && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false ) { // Get the next non-whitespace token. for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { if (is_array($tokens[$i]) === false - || $tokens[$i][0] !== T_WHITESPACE + || isset(Util\Tokens::$emptyTokens[$tokens[$i][0]]) === false ) { break; } } + $isReadonlyKeyword = false; + if (isset($tokens[$i]) === false || $tokens[$i] !== '(' ) { + $isReadonlyKeyword = true; + } else if ($tokens[$i] === '(') { + /* + * Skip over tokens which can be used in type declarations. + * At this point, the only token types which need to be taken into consideration + * as potential type declarations are identifier names, T_ARRAY, T_CALLABLE and T_NS_SEPARATOR + * and the union/intersection/dnf parentheses. + */ + + $foundDNFParens = 1; + $foundDNFPipe = 0; + + for (++$i; $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === true) { + $tokenType = $tokens[$i][0]; + } else { + $tokenType = $tokens[$i]; + } + + if (isset(Util\Tokens::$emptyTokens[$tokenType]) === true) { + continue; + } + + if ($tokenType === '|') { + ++$foundDNFPipe; + continue; + } + + if ($tokenType === ')') { + ++$foundDNFParens; + continue; + } + + if ($tokenType === '(') { + ++$foundDNFParens; + continue; + } + + if ($tokenType === T_STRING + || $tokenType === T_NAME_FULLY_QUALIFIED + || $tokenType === T_NAME_RELATIVE + || $tokenType === T_NAME_QUALIFIED + || $tokenType === T_ARRAY + || $tokenType === T_NAMESPACE + || $tokenType === T_NS_SEPARATOR + || $tokenType === T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG // PHP 8.0+. + || $tokenType === '&' // PHP < 8.0. + ) { + continue; + } + + // Reached the next token after. + if (($foundDNFParens % 2) === 0 + && $foundDNFPipe >= 1 + && ($tokenType === T_VARIABLE + || $tokenType === T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG) + ) { + $isReadonlyKeyword = true; + } + + break; + }//end for + }//end if + + if ($isReadonlyKeyword === true) { $finalTokens[$newStackPtr] = [ 'code' => T_READONLY, 'type' => 'T_READONLY', @@ -1306,8 +1403,23 @@ protected function tokenize($string) ]; $newStackPtr++; - continue; - } + if (PHP_CODESNIFFER_VERBOSITY > 1 && $type !== T_READONLY) { + echo "\t\t* token $stackPtr changed from $type to T_READONLY".PHP_EOL; + } + } else { + $finalTokens[$newStackPtr] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => $token[1], + ]; + $newStackPtr++; + + if (PHP_CODESNIFFER_VERBOSITY > 1 && $type !== T_STRING) { + echo "\t\t* token $stackPtr changed from $type to T_STRING".PHP_EOL; + } + }//end if + + continue; }//end if /* @@ -2103,38 +2215,60 @@ function return types. We want to keep the parenthesis map clean, } } else { // Some T_STRING tokens should remain that way due to their context. - if ($tokenIsArray === true - && $token[0] === T_STRING - && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true - ) { - // Special case for syntax like: return new self/new parent - // where self/parent should not be a string. - $tokenContentLower = strtolower($token[1]); - if ($finalTokens[$lastNotEmptyToken]['code'] === T_NEW - && ($tokenContentLower === 'self' || $tokenContentLower === 'parent') - ) { - $finalTokens[$newStackPtr] = [ - 'content' => $token[1], - ]; - if ($tokenContentLower === 'self') { - $finalTokens[$newStackPtr]['code'] = T_SELF; - $finalTokens[$newStackPtr]['type'] = 'T_SELF'; + if ($tokenIsArray === true && $token[0] === T_STRING) { + $preserveTstring = false; + + if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true) { + $preserveTstring = true; + + // Special case for syntax like: return new self/new parent + // where self/parent should not be a string. + $tokenContentLower = strtolower($token[1]); + if ($finalTokens[$lastNotEmptyToken]['code'] === T_NEW + && ($tokenContentLower === 'self' || $tokenContentLower === 'parent') + ) { + $preserveTstring = false; } + } else if ($finalTokens[$lastNotEmptyToken]['content'] === '&') { + // Function names for functions declared to return by reference. + for ($i = ($lastNotEmptyToken - 1); $i >= 0; $i--) { + if (isset(Util\Tokens::$emptyTokens[$finalTokens[$i]['code']]) === true) { + continue; + } + + if ($finalTokens[$i]['code'] === T_FUNCTION) { + $preserveTstring = true; + } - if ($tokenContentLower === 'parent') { - $finalTokens[$newStackPtr]['code'] = T_PARENT; - $finalTokens[$newStackPtr]['type'] = 'T_PARENT'; + break; } } else { + // Keywords with special PHPCS token when used as a function call. + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === true + && isset(Util\Tokens::$emptyTokens[$tokens[$i][0]]) === true + ) { + continue; + } + + if ($tokens[$i][0] === '(') { + $preserveTstring = true; + } + + break; + } + }//end if + + if ($preserveTstring === true) { $finalTokens[$newStackPtr] = [ - 'content' => $token[1], 'code' => T_STRING, 'type' => 'T_STRING', + 'content' => $token[1], ]; - } - $newStackPtr++; - continue; + $newStackPtr++; + continue; + } }//end if $newToken = null; @@ -2249,11 +2383,12 @@ function return types. We want to keep the parenthesis map clean, if (is_array($tokens[$i]) === false && ($tokens[$i] === ';' - || $tokens[$i] === '{') + || $tokens[$i] === '{' + || $tokens[$i] === '}') ) { break; } - } + }//end for }//end if if ($isInlineIf === true) { @@ -2803,6 +2938,7 @@ protected function processAdditional() T_PARENT => T_PARENT, T_STATIC => T_STATIC, T_FALSE => T_FALSE, + T_TRUE => T_TRUE, T_NULL => T_NULL, T_NAMESPACE => T_NAMESPACE, T_NS_SEPARATOR => T_NS_SEPARATOR, @@ -2862,6 +2998,10 @@ protected function processAdditional() continue; } + if ($suspectedType === 'property or parameter') { + unset($allowed[\T_STATIC]); + } + $typeTokenCount = 0; $typeOperators = [$i]; $confirmed = false; @@ -2894,6 +3034,7 @@ protected function processAdditional() if ($suspectedType === 'property or parameter' && (isset(Util\Tokens::$scopeModifiers[$this->tokens[$x]['code']]) === true || $this->tokens[$x]['code'] === T_VAR + || $this->tokens[$x]['code'] === T_STATIC || $this->tokens[$x]['code'] === T_READONLY) ) { // This will also confirm constructor property promotion parameters, but that's fine. @@ -2995,14 +3136,16 @@ protected function processAdditional() || $this->tokens[$i]['code'] === T_FALSE || $this->tokens[$i]['code'] === T_NULL ) { - for ($x = ($i + 1); $i < $numTokens; $x++) { + for ($x = ($i + 1); $x < $numTokens; $x++) { if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { // Non-whitespace content. break; } } - if (isset($this->tstringContexts[$this->tokens[$x]['code']]) === true) { + if ($x !== $numTokens + && isset($this->tstringContexts[$this->tokens[$x]['code']]) === true + ) { if (PHP_CODESNIFFER_VERBOSITY > 1) { $line = $this->tokens[$i]['line']; $type = $this->tokens[$i]['type']; diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php index 0e00bf7f..bfe8c7a1 100644 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tokenizers; @@ -27,7 +27,7 @@ abstract class Tokenizer * * @var string */ - protected $eolChar = []; + protected $eolChar = ''; /** * A token-based representation of the content. @@ -60,7 +60,7 @@ abstract class Tokenizer /** * Known lengths of tokens. * - * @var array + * @var array */ public $knownLengths = []; diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Cache.php b/vendor/squizlabs/php_codesniffer/src/Util/Cache.php index 68abef59..932952e4 100644 --- a/vendor/squizlabs/php_codesniffer/src/Util/Cache.php +++ b/vendor/squizlabs/php_codesniffer/src/Util/Cache.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Util; @@ -19,7 +19,7 @@ class Cache /** * The filesystem location of the cache file. * - * @var void + * @var string */ private static $path = ''; diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Common.php b/vendor/squizlabs/php_codesniffer/src/Util/Common.php index ce7967cc..afed49e7 100644 --- a/vendor/squizlabs/php_codesniffer/src/Util/Common.php +++ b/vendor/squizlabs/php_codesniffer/src/Util/Common.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Util; @@ -35,7 +35,7 @@ class Common * * @param string $path The path to use. * - * @return mixed + * @return bool */ public static function isPharFile($path) { @@ -83,7 +83,7 @@ public static function isReadable($path) * * @param string $path The path to use. * - * @return mixed + * @return string|false */ public static function realpath($path) { diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Standards.php b/vendor/squizlabs/php_codesniffer/src/Util/Standards.php index 65e5d6cb..ca1060bc 100644 --- a/vendor/squizlabs/php_codesniffer/src/Util/Standards.php +++ b/vendor/squizlabs/php_codesniffer/src/Util/Standards.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Util; diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Timing.php b/vendor/squizlabs/php_codesniffer/src/Util/Timing.php index 95ee8521..36f43463 100644 --- a/vendor/squizlabs/php_codesniffer/src/Util/Timing.php +++ b/vendor/squizlabs/php_codesniffer/src/Util/Timing.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Util; @@ -40,6 +40,51 @@ public static function startTiming() }//end startTiming() + /** + * Get the duration of the run up to "now". + * + * @return int Duration in microseconds. + */ + public static function getDuration() + { + if (self::$startTime === null) { + // Timing was never started. + return 0; + } + + return ((microtime(true) - self::$startTime) * 1000); + + }//end getDuration() + + + /** + * Convert a duration in microseconds to a human readable duration string. + * + * @param int $duration Duration in microseconds. + * + * @return string + */ + public static function getHumanReadableDuration($duration) + { + $timeString = ''; + if ($duration > 60000) { + $mins = floor($duration / 60000); + $secs = round((fmod($duration, 60000) / 1000), 2); + $timeString = $mins.' mins'; + if ($secs !== 0) { + $timeString .= ", $secs secs"; + } + } else if ($duration > 1000) { + $timeString = round(($duration / 1000), 2).' secs'; + } else { + $timeString = round($duration).'ms'; + } + + return $timeString; + + }//end getHumanReadableDuration() + + /** * Print information about the run. * @@ -60,23 +105,11 @@ public static function printRunTime($force=false) return; } - $time = ((microtime(true) - self::$startTime) * 1000); - - if ($time > 60000) { - $mins = floor($time / 60000); - $secs = round((fmod($time, 60000) / 1000), 2); - $time = $mins.' mins'; - if ($secs !== 0) { - $time .= ", $secs secs"; - } - } else if ($time > 1000) { - $time = round(($time / 1000), 2).' secs'; - } else { - $time = round($time).'ms'; - } + $duration = self::getDuration(); + $duration = self::getHumanReadableDuration($duration); $mem = round((memory_get_peak_usage(true) / (1024 * 1024)), 2).'MB'; - echo "Time: $time; Memory: $mem".PHP_EOL.PHP_EOL; + echo "Time: $duration; Memory: $mem".PHP_EOL.PHP_EOL; self::$printed = true; diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php b/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php index bb1fb2ca..ab70e783 100644 --- a/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php +++ b/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Util; diff --git a/vendor/squizlabs/php_codesniffer/tests/AllTests.php b/vendor/squizlabs/php_codesniffer/tests/AllTests.php index 9d099c1e..4fa41d9d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/AllTests.php +++ b/vendor/squizlabs/php_codesniffer/tests/AllTests.php @@ -4,19 +4,13 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests; -if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === false) { - include_once 'Core/AllTests.php'; - include_once 'Standards/AllSniffs.php'; -} else { - include_once 'CodeSniffer/Core/AllTests.php'; - include_once 'CodeSniffer/Standards/AllSniffs.php'; - include_once 'FileList.php'; -} +require_once 'Core/AllTests.php'; +require_once 'Standards/AllSniffs.php'; // PHPUnit 7 made the TestSuite run() method incompatible with // older PHPUnit versions due to return type hints, so maintain @@ -24,7 +18,7 @@ $phpunit7 = false; if (class_exists('\PHPUnit\Runner\Version') === true) { $version = \PHPUnit\Runner\Version::id(); - if ($version[0] === '7') { + if (version_compare($version, '7.0', '>=') === true) { $phpunit7 = true; } } diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php index 4d4f5469..21216fb6 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2018-2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core; @@ -13,6 +13,7 @@ use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Files\DummyFile; use PHPUnit\Framework\TestCase; +use ReflectionProperty; abstract class AbstractMethodUnitTest extends TestCase { @@ -41,13 +42,28 @@ abstract class AbstractMethodUnitTest extends TestCase * The test case file for a unit test class has to be in the same directory * directory and use the same file name as the test class, using the .inc extension. * + * @beforeClass + * * @return void */ - public static function setUpBeforeClass() + public static function initializeFile() { - $config = new Config(); - $config->standards = ['PSR1']; + /* + * Set the static properties in the Config class to specific values for performance + * and to clear out values from other tests. + */ + + self::setStaticConfigProperty('executablePaths', []); + + // Set to a usable value to circumvent Config trying to find a phpcs.xml config file. + self::setStaticConfigProperty('overriddenDefaults', ['standards' => ['PSR1']]); + + // Set to values which prevent the test-runner user's `CodeSniffer.conf` file + // from being read and influencing the tests. Also prevent an `exec()` call to stty. + self::setStaticConfigProperty('configData', ['report_width' => 80]); + self::setStaticConfigProperty('configDataFile', ''); + $config = new Config(); $ruleset = new Ruleset($config); // Default to a file with the same name as the test class. Extension is property based. @@ -62,19 +78,45 @@ public static function setUpBeforeClass() self::$phpcsFile = new DummyFile($contents, $ruleset, $config); self::$phpcsFile->process(); - }//end setUpBeforeClass() + }//end initializeFile() /** * Clean up after finished test. * + * @afterClass + * * @return void */ - public static function tearDownAfterClass() + public static function resetFile() { self::$phpcsFile = null; - }//end tearDownAfterClass() + // Reset the static properties in the Config class to their defaults to prevent tests influencing each other. + self::setStaticConfigProperty('overriddenDefaults', []); + self::setStaticConfigProperty('executablePaths', []); + self::setStaticConfigProperty('configData', null); + self::setStaticConfigProperty('configDataFile', null); + + }//end resetFile() + + + /** + * Helper function to set the value of a private static property on the Config class. + * + * @param string $name The name of the property to set. + * @param mixed $value The value to set the property to. + * + * @return void + */ + public static function setStaticConfigProperty($name, $value) + { + $property = new ReflectionProperty('PHP_CodeSniffer\Config', $name); + $property->setAccessible(true); + $property->setValue(null, $value); + $property->setAccessible(false); + + }//end setStaticConfigProperty() /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/AllTests.php b/vendor/squizlabs/php_codesniffer/tests/Core/AllTests.php index 304690ef..60547bb3 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/AllTests.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/AllTests.php @@ -5,7 +5,7 @@ * @author Greg Sherwood * @author Juliette Reinders Folmer * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php index c0f38fa6..e4a27258 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Autoloader; @@ -19,13 +19,15 @@ class DetermineLoadedClassTest extends TestCase /** * Load the test files. * + * @beforeClass + * * @return void */ - public static function setUpBeforeClass() + public static function includeFixture() { include __DIR__.'/TestFiles/Sub/C.inc'; - }//end setUpBeforeClass() + }//end includeFixture() /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Config/ReportWidthTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Config/ReportWidthTest.php new file mode 100644 index 00000000..275a70ca --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Config/ReportWidthTest.php @@ -0,0 +1,304 @@ + + * @copyright 2006-2023 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Config; + +use PHP_CodeSniffer\Config; +use PHPUnit\Framework\TestCase; +use ReflectionProperty; + +class ReportWidthTest extends TestCase +{ + + + /** + * Set static properties in the Config class to prevent tests influencing each other. + * + * @before + * + * @return void + */ + public static function cleanConfig() + { + // Set to the property's default value to clear out potentially set values from other tests. + self::setStaticProperty('executablePaths', []); + + // Set to a usable value to circumvent Config trying to find a phpcs.xml config file. + self::setStaticProperty('overriddenDefaults', ['standards' => ['PSR1']]); + + // Set to values which prevent the test-runner user's `CodeSniffer.conf` file + // from being read and influencing the tests. + self::setStaticProperty('configData', []); + self::setStaticProperty('configDataFile', ''); + + }//end cleanConfig() + + + /** + * Clean up after each finished test. + * + * @after + * + * @return void + */ + public function resetConfig() + { + $_SERVER['argv'] = []; + + }//end resetConfig() + + + /** + * Reset the static properties in the Config class to their true defaults to prevent this class + * from influencing other tests. + * + * @afterClass + * + * @return void + */ + public static function resetConfigToDefaults() + { + self::setStaticProperty('overriddenDefaults', []); + self::setStaticProperty('executablePaths', []); + self::setStaticProperty('configData', null); + self::setStaticProperty('configDataFile', null); + $_SERVER['argv'] = []; + + }//end resetConfigToDefaults() + + + /** + * Test that report width without overrules will always be set to a non-0 positive integer. + * + * @return void + */ + public function testReportWidthDefault() + { + $config = new Config(); + + // Can't test the exact value as "auto" will resolve differently depending on the machine running the tests. + $this->assertTrue(is_int($config->reportWidth), 'Report width is not an integer'); + $this->assertGreaterThan(0, $config->reportWidth, 'Report width is not greater than 0'); + + }//end testReportWidthDefault() + + + /** + * Test that the report width will be set to a non-0 positive integer when not found in the CodeSniffer.conf file. + * + * @return void + */ + public function testReportWidthWillBeSetFromAutoWhenNotFoundInConfFile() + { + $phpCodeSnifferConfig = [ + 'default_standard' => 'PSR2', + 'show_warnings' => '0', + ]; + + $this->setStaticProperty('configData', $phpCodeSnifferConfig); + + $config = new Config(); + + // Can't test the exact value as "auto" will resolve differently depending on the machine running the tests. + $this->assertTrue(is_int($config->reportWidth), 'Report width is not an integer'); + $this->assertGreaterThan(0, $config->reportWidth, 'Report width is not greater than 0'); + + }//end testReportWidthWillBeSetFromAutoWhenNotFoundInConfFile() + + + /** + * Test that the report width will be set correctly when found in the CodeSniffer.conf file. + * + * @return void + */ + public function testReportWidthCanBeSetFromConfFile() + { + $phpCodeSnifferConfig = [ + 'default_standard' => 'PSR2', + 'report_width' => '120', + ]; + + $this->setStaticProperty('configData', $phpCodeSnifferConfig); + + $config = new Config(); + $this->assertSame(120, $config->reportWidth); + + }//end testReportWidthCanBeSetFromConfFile() + + + /** + * Test that the report width will be set correctly when passed as a CLI argument. + * + * @return void + */ + public function testReportWidthCanBeSetFromCLI() + { + $_SERVER['argv'] = [ + 'phpcs', + '--report-width=100', + ]; + + $config = new Config(); + $this->assertSame(100, $config->reportWidth); + + }//end testReportWidthCanBeSetFromCLI() + + + /** + * Test that the report width will be set correctly when multiple report widths are passed on the CLI. + * + * @return void + */ + public function testReportWidthWhenSetFromCLIFirstValuePrevails() + { + $_SERVER['argv'] = [ + 'phpcs', + '--report-width=100', + '--report-width=200', + ]; + + $config = new Config(); + $this->assertSame(100, $config->reportWidth); + + }//end testReportWidthWhenSetFromCLIFirstValuePrevails() + + + /** + * Test that a report width passed as a CLI argument will overrule a report width set in a CodeSniffer.conf file. + * + * @return void + */ + public function testReportWidthSetFromCLIOverrulesConfFile() + { + $phpCodeSnifferConfig = [ + 'default_standard' => 'PSR2', + 'report_format' => 'summary', + 'show_warnings' => '0', + 'show_progress' => '1', + 'report_width' => '120', + ]; + + $this->setStaticProperty('configData', $phpCodeSnifferConfig); + + $cliArgs = [ + 'phpcs', + '--report-width=180', + ]; + + $config = new Config($cliArgs); + $this->assertSame(180, $config->reportWidth); + + }//end testReportWidthSetFromCLIOverrulesConfFile() + + + /** + * Test that the report width will be set to a non-0 positive integer when set to "auto". + * + * @return void + */ + public function testReportWidthInputHandlingForAuto() + { + $config = new Config(); + $config->reportWidth = 'auto'; + + // Can't test the exact value as "auto" will resolve differently depending on the machine running the tests. + $this->assertTrue(is_int($config->reportWidth), 'Report width is not an integer'); + $this->assertGreaterThan(0, $config->reportWidth, 'Report width is not greater than 0'); + + }//end testReportWidthInputHandlingForAuto() + + + /** + * Test that the report width will be set correctly for various types of input. + * + * @param mixed $input Input value received. + * @param int $expected Expected report width. + * + * @dataProvider dataReportWidthInputHandling + * + * @return void + */ + public function testReportWidthInputHandling($input, $expected) + { + $config = new Config(); + $config->reportWidth = $input; + + $this->assertSame($expected, $config->reportWidth); + + }//end testReportWidthInputHandling() + + + /** + * Data provider. + * + * @return array + */ + public function dataReportWidthInputHandling() + { + return [ + 'No value (empty string)' => [ + 'value' => '', + 'expected' => Config::DEFAULT_REPORT_WIDTH, + ], + 'Value: invalid input type null' => [ + 'value' => null, + 'expected' => Config::DEFAULT_REPORT_WIDTH, + ], + 'Value: invalid input type false' => [ + 'value' => false, + 'expected' => Config::DEFAULT_REPORT_WIDTH, + ], + 'Value: invalid input type float' => [ + 'value' => 100.50, + 'expected' => Config::DEFAULT_REPORT_WIDTH, + ], + 'Value: invalid string value "invalid"' => [ + 'value' => 'invalid', + 'expected' => Config::DEFAULT_REPORT_WIDTH, + ], + 'Value: invalid string value, non-integer string "50.25"' => [ + 'value' => '50.25', + 'expected' => Config::DEFAULT_REPORT_WIDTH, + ], + 'Value: valid numeric string value' => [ + 'value' => '250', + 'expected' => 250, + ], + 'Value: valid int value' => [ + 'value' => 220, + 'expected' => 220, + ], + 'Value: negative int value becomes positive int' => [ + 'value' => -180, + 'expected' => 180, + ], + ]; + + }//end dataReportWidthInputHandling() + + + /** + * Helper function to set a static property on the Config class. + * + * @param string $name The name of the property to set. + * @param mixed $value The value to set the property to. + * + * @return void + */ + public static function setStaticProperty($name, $value) + { + $property = new ReflectionProperty('PHP_CodeSniffer\Config', $name); + $property->setAccessible(true); + $property->setValue(null, $value); + $property->setAccessible(false); + + }//end setStaticProperty() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/ErrorSuppressionTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/ErrorSuppressionTest.php index 7181613c..3c99f5f9 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/ErrorSuppressionTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/ErrorSuppressionTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php index 7bff26b5..4f9b3b06 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.php index f39377e6..a82e1e59 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php index 23950328..4e2885f1 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php index ff859eca..dabb706c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.inc new file mode 100644 index 00000000..2490a096 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.inc @@ -0,0 +1,58 @@ + + * @copyright 2022 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\File; + +use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; + +class GetClassPropertiesTest extends AbstractMethodUnitTest +{ + + + /** + * Test receiving an expected exception when a non class token is passed. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * @param array $tokenType The type of token to look for after the marker. + * + * @dataProvider dataNotAClassException + * + * @return void + */ + public function testNotAClassException($testMarker, $tokenType) + { + $msg = '$stackPtr must be of type T_CLASS'; + $exception = 'PHP_CodeSniffer\Exceptions\RuntimeException'; + + if (\method_exists($this, 'expectException') === true) { + // PHPUnit 5+. + $this->expectException($exception); + $this->expectExceptionMessage($msg); + } else { + // PHPUnit 4. + $this->setExpectedException($exception, $msg); + } + + $target = $this->getTargetToken($testMarker, $tokenType); + self::$phpcsFile->getClassProperties($target); + + }//end testNotAClassException() + + + /** + * Data provider. + * + * @see testNotAClassException() For the array format. + * + * @return array + */ + public function dataNotAClassException() + { + return [ + 'interface' => [ + '/* testNotAClass */', + \T_INTERFACE, + ], + 'anon-class' => [ + '/* testAnonClass */', + \T_ANON_CLASS, + ], + 'enum' => [ + '/* testEnum */', + \T_ENUM, + ], + ]; + + }//end dataNotAClassException() + + + /** + * Test retrieving the properties for a class declaration. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * @param array $expected Expected function output. + * + * @dataProvider dataGetClassProperties + * + * @return void + */ + public function testGetClassProperties($testMarker, $expected) + { + $class = $this->getTargetToken($testMarker, \T_CLASS); + $result = self::$phpcsFile->getClassProperties($class); + $this->assertSame($expected, $result); + + }//end testGetClassProperties() + + + /** + * Data provider. + * + * @see testGetClassProperties() For the array format. + * + * @return array + */ + public function dataGetClassProperties() + { + return [ + 'no-properties' => [ + '/* testClassWithoutProperties */', + [ + 'is_abstract' => false, + 'is_final' => false, + 'is_readonly' => false, + ], + ], + 'abstract' => [ + '/* testAbstractClass */', + [ + 'is_abstract' => true, + 'is_final' => false, + 'is_readonly' => false, + ], + ], + 'final' => [ + '/* testFinalClass */', + [ + 'is_abstract' => false, + 'is_final' => true, + 'is_readonly' => false, + ], + ], + 'readonly' => [ + '/* testReadonlyClass */', + [ + 'is_abstract' => false, + 'is_final' => false, + 'is_readonly' => true, + ], + ], + 'final-readonly' => [ + '/* testFinalReadonlyClass */', + [ + 'is_abstract' => false, + 'is_final' => true, + 'is_readonly' => true, + ], + ], + 'readonly-final' => [ + '/* testReadonlyFinalClass */', + [ + 'is_abstract' => false, + 'is_final' => true, + 'is_readonly' => true, + ], + ], + 'abstract-readonly' => [ + '/* testAbstractReadonlyClass */', + [ + 'is_abstract' => true, + 'is_final' => false, + 'is_readonly' => true, + ], + ], + 'readonly-abstract' => [ + '/* testReadonlyAbstractClass */', + [ + 'is_abstract' => true, + 'is_final' => false, + 'is_readonly' => true, + ], + ], + 'comments-and-new-lines' => [ + '/* testWithCommentsAndNewLines */', + [ + 'is_abstract' => true, + 'is_final' => false, + 'is_readonly' => false, + ], + ], + 'no-properties-with-docblock' => [ + '/* testWithDocblockWithoutProperties */', + [ + 'is_abstract' => false, + 'is_final' => false, + 'is_readonly' => false, + ], + ], + 'abstract-final-parse-error' => [ + '/* testParseErrorAbstractFinal */', + [ + 'is_abstract' => true, + 'is_final' => true, + 'is_readonly' => false, + ], + ], + ]; + + }//end dataGetClassProperties() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc index f40b6021..441bd977 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc @@ -210,18 +210,19 @@ $anon = class() { /* testPHP8UnionTypesIllegalTypes */ // Intentional fatal error - types which are not allowed for properties, but that's not the concern of the method. - public callable|static|void $unionTypesIllegalTypes; + // Note: static is also not allowed as a type, but using static for a property type is not supported by the tokenizer. + public callable|void $unionTypesIllegalTypes; /* testPHP8UnionTypesNullable */ // Intentional fatal error - nullability is not allowed with union types, but that's not the concern of the method. public ?int|float $unionTypesNullable; /* testPHP8PseudoTypeNull */ - // Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. + // PHP 8.0 - 8.1: Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. public null $pseudoTypeNull; /* testPHP8PseudoTypeFalse */ - // Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. + // PHP 8.0 - 8.1: Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. public false $pseudoTypeFalse; /* testPHP8PseudoTypeFalseAndBool */ @@ -298,7 +299,22 @@ $anon = class() { // Intentional fatal error - types which are not allowed for intersection type, but that's not the concern of the method. public int&string $illegalIntersectionType; - /* testPHP81NulltableIntersectionType */ + /* testPHP81NullableIntersectionType */ // Intentional fatal error - nullability is not allowed with intersection type, but that's not the concern of the method. public ?Foo&Bar $nullableIntersectionType; }; + +$anon = class() { + /* testPHP82PseudoTypeTrue */ + public true $pseudoTypeTrue; + + /* testPHP82NullablePseudoTypeTrue */ + static protected ?true $pseudoTypeNullableTrue; + + /* testPHP82PseudoTypeTrueInUnion */ + private int|string|true $pseudoTypeTrueInUnion; + + /* testPHP82PseudoTypeFalseAndTrue */ + // Intentional fatal error - Type contains both true and false, bool should be used instead, but that's not the concern of the method. + readonly true|FALSE $pseudoTypeFalseAndTrue; +}; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php index 934d8e28..272f3b2e 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; @@ -30,7 +30,10 @@ public function testGetMemberProperties($identifier, $expected) $variable = $this->getTargetToken($identifier, T_VARIABLE); $result = self::$phpcsFile->getMemberProperties($variable); - $this->assertArraySubset($expected, $result, true); + // Unset those indexes which are not being tested. + unset($result['type_token'], $result['type_end_token']); + + $this->assertSame($expected, $result); }//end testGetMemberProperties() @@ -584,8 +587,7 @@ public function dataGetMemberProperties() 'scope_specified' => true, 'is_static' => false, 'is_readonly' => false, - // Missing static, but that's OK as not an allowed syntax. - 'type' => 'callable||void', + 'type' => 'callable|void', 'nullable_type' => false, ], ], @@ -764,6 +766,7 @@ public function dataGetMemberProperties() 'scope' => 'public', 'scope_specified' => true, 'is_static' => false, + 'is_readonly' => false, 'type' => 'Foo&Bar', 'nullable_type' => false, ], @@ -774,6 +777,7 @@ public function dataGetMemberProperties() 'scope' => 'public', 'scope_specified' => true, 'is_static' => false, + 'is_readonly' => false, 'type' => 'Foo&Bar&Baz', 'nullable_type' => false, ], @@ -784,20 +788,67 @@ public function dataGetMemberProperties() 'scope' => 'public', 'scope_specified' => true, 'is_static' => false, + 'is_readonly' => false, 'type' => 'int&string', 'nullable_type' => false, ], ], [ - '/* testPHP81NulltableIntersectionType */', + '/* testPHP81NullableIntersectionType */', [ 'scope' => 'public', 'scope_specified' => true, 'is_static' => false, + 'is_readonly' => false, 'type' => '?Foo&Bar', 'nullable_type' => true, ], ], + [ + '/* testPHP82PseudoTypeTrue */', + [ + 'scope' => 'public', + 'scope_specified' => true, + 'is_static' => false, + 'is_readonly' => false, + 'type' => 'true', + 'nullable_type' => false, + ], + ], + [ + '/* testPHP82NullablePseudoTypeTrue */', + [ + 'scope' => 'protected', + 'scope_specified' => true, + 'is_static' => true, + 'is_readonly' => false, + 'type' => '?true', + 'nullable_type' => true, + ], + ], + [ + '/* testPHP82PseudoTypeTrueInUnion */', + [ + 'scope' => 'private', + 'scope_specified' => true, + 'is_static' => false, + 'is_readonly' => false, + 'type' => 'int|string|true', + 'nullable_type' => false, + ], + ], + [ + '/* testPHP82PseudoTypeFalseAndTrue */', + [ + 'scope' => 'public', + 'scope_specified' => false, + 'is_static' => false, + 'is_readonly' => true, + 'type' => 'true|FALSE', + 'nullable_type' => false, + ], + ], + ]; }//end dataGetMemberProperties() @@ -808,15 +859,24 @@ public function dataGetMemberProperties() * * @param string $identifier Comment which precedes the test case. * - * @expectedException PHP_CodeSniffer\Exceptions\RuntimeException - * @expectedExceptionMessage $stackPtr is not a class member var - * * @dataProvider dataNotClassProperty * * @return void */ public function testNotClassPropertyException($identifier) { + $msg = '$stackPtr is not a class member var'; + $exception = 'PHP_CodeSniffer\Exceptions\RuntimeException'; + + if (\method_exists($this, 'expectException') === true) { + // PHPUnit 5+. + $this->expectException($exception); + $this->expectExceptionMessage($msg); + } else { + // PHPUnit 4. + $this->setExpectedException($exception, $msg); + } + $variable = $this->getTargetToken($identifier, T_VARIABLE); $result = self::$phpcsFile->getMemberProperties($variable); @@ -848,13 +908,22 @@ public function dataNotClassProperty() /** * Test receiving an expected exception when a non variable is passed. * - * @expectedException PHP_CodeSniffer\Exceptions\RuntimeException - * @expectedExceptionMessage $stackPtr must be of type T_VARIABLE - * * @return void */ public function testNotAVariableException() { + $msg = '$stackPtr must be of type T_VARIABLE'; + $exception = 'PHP_CodeSniffer\Exceptions\RuntimeException'; + + if (\method_exists($this, 'expectException') === true) { + // PHPUnit 5+. + $this->expectException($exception); + $this->expectExceptionMessage($msg); + } else { + // PHPUnit 4. + $this->setExpectedException($exception, $msg); + } + $next = $this->getTargetToken('/* testNotAVariable */', T_RETURN); $result = self::$phpcsFile->getMemberProperties($next); diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc index dc465491..2635e092 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc @@ -66,11 +66,11 @@ function unionTypesAllPseudoTypes(false|mixed|self|parent|iterable|Resource $var $closure = function (?int|float $number) {}; /* testPHP8PseudoTypeNull */ -// Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. +// PHP 8.0 - 8.1: Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. function pseudoTypeNull(null $var = null) {} /* testPHP8PseudoTypeFalse */ -// Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. +// PHP 8.0 - 8.1: Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. function pseudoTypeFalse(false $var = false) {} /* testPHP8PseudoTypeFalseAndBool */ @@ -113,6 +113,11 @@ class ConstructorPropertyPromotionWithReadOnly { public function __construct(public readonly ?int $promotedProp, readonly private string|bool &$promotedToo) {} } +class ConstructorPropertyPromotionWithOnlyReadOnly { + /* testPHP81ConstructorPropertyPromotionWithOnlyReadOnly */ + public function __construct(readonly Foo&Bar $promotedProp, readonly ?bool $promotedToo,) {} +} + /* testPHP8ConstructorPropertyPromotionGlobalFunction */ // Intentional fatal error. Property promotion not allowed in non-constructor, but that's not the concern of this method. function globalFunction(private $x) {} @@ -162,3 +167,10 @@ $closure = function (string&int $numeric_string) {}; /* testPHP81NullableIntersectionTypes */ // Intentional fatal error - nullability is not allowed with intersection types, but that's not the concern of the method. $closure = function (?Foo&Bar $object) {}; + +/* testPHP82PseudoTypeTrue */ +function pseudoTypeTrue(?true $var = true) {} + +/* testPHP82PseudoTypeFalseAndTrue */ +// Intentional fatal error - Type contains both true and false, bool should be used instead, but that's not the concern of the method. +function pseudoTypeFalseAndTrue(true|false $var = true) {} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php index ba4d7544..fd4742ae 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; @@ -95,8 +95,8 @@ public function testSingleDefaultValue() $expected[0] = [ 'name' => '$var1', 'content' => '$var1=self::CONSTANT', - 'has_attributes' => false, 'default' => 'self::CONSTANT', + 'has_attributes' => false, 'pass_by_reference' => false, 'variable_length' => false, 'type_hint' => '', @@ -119,8 +119,8 @@ public function testDefaultValues() $expected[0] = [ 'name' => '$var1', 'content' => '$var1=1', - 'has_attributes' => false, 'default' => '1', + 'has_attributes' => false, 'pass_by_reference' => false, 'variable_length' => false, 'type_hint' => '', @@ -129,8 +129,8 @@ public function testDefaultValues() $expected[1] = [ 'name' => '$var2', 'content' => "\$var2='value'", - 'has_attributes' => false, 'default' => "'value'", + 'has_attributes' => false, 'pass_by_reference' => false, 'variable_length' => false, 'type_hint' => '', @@ -846,6 +846,43 @@ public function testPHP81ConstructorPropertyPromotionWithReadOnly() }//end testPHP81ConstructorPropertyPromotionWithReadOnly() + /** + * Verify recognition of PHP8 constructor with property promotion using PHP 8.1 readonly + * keyword without explicit visibility. + * + * @return void + */ + public function testPHP81ConstructorPropertyPromotionWithOnlyReadOnly() + { + $expected = []; + $expected[0] = [ + 'name' => '$promotedProp', + 'content' => 'readonly Foo&Bar $promotedProp', + 'has_attributes' => false, + 'pass_by_reference' => false, + 'variable_length' => false, + 'type_hint' => 'Foo&Bar', + 'nullable_type' => false, + 'property_visibility' => 'public', + 'property_readonly' => true, + ]; + $expected[1] = [ + 'name' => '$promotedToo', + 'content' => 'readonly ?bool $promotedToo', + 'has_attributes' => false, + 'pass_by_reference' => false, + 'variable_length' => false, + 'type_hint' => '?bool', + 'nullable_type' => true, + 'property_visibility' => 'public', + 'property_readonly' => true, + ]; + + $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); + + }//end testPHP81ConstructorPropertyPromotionWithOnlyReadOnly() + + /** * Verify behaviour when a non-constructor function uses PHP 8 property promotion syntax. * @@ -863,6 +900,7 @@ public function testPHP8ConstructorPropertyPromotionGlobalFunction() 'type_hint' => '', 'nullable_type' => false, 'property_visibility' => 'private', + 'property_readonly' => false, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); @@ -887,6 +925,7 @@ public function testPHP8ConstructorPropertyPromotionAbstractMethod() 'type_hint' => 'callable', 'nullable_type' => false, 'property_visibility' => 'public', + 'property_readonly' => false, ]; $expected[1] = [ 'name' => '$x', @@ -897,6 +936,7 @@ public function testPHP8ConstructorPropertyPromotionAbstractMethod() 'type_hint' => '', 'nullable_type' => false, 'property_visibility' => 'private', + 'property_readonly' => false, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); @@ -916,6 +956,7 @@ public function testCommentsInParameter() 'name' => '$param', 'content' => '// Leading comment. ?MyClass /*-*/ & /*-*/.../*-*/ $param /*-*/ = /*-*/ \'default value\' . /*-*/ \'second part\' // Trailing comment.', + 'default' => '\'default value\' . /*-*/ \'second part\' // Trailing comment.', 'has_attributes' => false, 'pass_by_reference' => true, 'variable_length' => true, @@ -945,6 +986,7 @@ public function testParameterAttributesInFunctionDeclaration() 'type_hint' => 'string', 'nullable_type' => false, 'property_visibility' => 'private', + 'property_readonly' => false, ]; $expected[1] = [ 'name' => '$typedParamSingleAttribute', @@ -1124,6 +1166,54 @@ public function testPHP81NullableIntersectionTypes() }//end testPHP81NullableIntersectionTypes() + /** + * Verify recognition of PHP 8.2 stand-alone `true` type. + * + * @return void + */ + public function testPHP82PseudoTypeTrue() + { + $expected = []; + $expected[0] = [ + 'name' => '$var', + 'content' => '?true $var = true', + 'default' => 'true', + 'has_attributes' => false, + 'pass_by_reference' => false, + 'variable_length' => false, + 'type_hint' => '?true', + 'nullable_type' => true, + ]; + + $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); + + }//end testPHP82PseudoTypeTrue() + + + /** + * Verify recognition of PHP 8.2 type declaration with (illegal) type false combined with type true. + * + * @return void + */ + public function testPHP82PseudoTypeFalseAndTrue() + { + $expected = []; + $expected[0] = [ + 'name' => '$var', + 'content' => 'true|false $var = true', + 'default' => 'true', + 'has_attributes' => false, + 'pass_by_reference' => false, + 'variable_length' => false, + 'type_hint' => 'true|false', + 'nullable_type' => false, + ]; + + $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); + + }//end testPHP82PseudoTypeFalseAndTrue() + + /** * Test helper. * @@ -1137,7 +1227,23 @@ private function getMethodParametersTestHelper($commentString, $expected) $function = $this->getTargetToken($commentString, [T_FUNCTION, T_CLOSURE, T_FN]); $found = self::$phpcsFile->getMethodParameters($function); - $this->assertArraySubset($expected, $found, true); + // Unset those indexes which are not being tested. + foreach ($found as $i => $param) { + unset( + $found[$i]['token'], + $found[$i]['reference_token'], + $found[$i]['variadic_token'], + $found[$i]['type_hint_token'], + $found[$i]['type_hint_end_token'], + $found[$i]['comma_token'], + $found[$i]['default_token'], + $found[$i]['default_equal_token'], + $found[$i]['visibility_token'], + $found[$i]['readonly_token'] + ); + } + + $this->assertSame($expected, $found); }//end getMethodParametersTestHelper() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc index 0c592369..5ebee679 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc @@ -102,11 +102,11 @@ function unionTypesAllPseudoTypes($var) : false|MIXED|self|parent|static|iterabl $closure = function () use($a) :?int|float {}; /* testPHP8PseudoTypeNull */ -// Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. +// PHP 8.0 - 8.1: Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. function pseudoTypeNull(): null {} /* testPHP8PseudoTypeFalse */ -// Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. +// PHP 8.0 - 8.1: Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. function pseudoTypeFalse(): false {} /* testPHP8PseudoTypeFalseAndBool */ @@ -150,3 +150,10 @@ $closure = function (): string&int {}; /* testPHP81NullableIntersectionTypes */ // Intentional fatal error - nullability is not allowed with intersection types, but that's not the concern of the method. $closure = function (): ?Foo&Bar {}; + +/* testPHP82PseudoTypeTrue */ +function pseudoTypeTrue(): ?true {} + +/* testPHP82PseudoTypeFalseAndTrue */ +// Intentional fatal error - Type contains both true and false, bool should be used instead, but that's not the concern of the method. +function pseudoTypeFalseAndTrue(): true|false {} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php index 66f4eea3..ab8fe66f 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; @@ -889,6 +889,52 @@ public function testPHP81NullableIntersectionTypes() }//end testPHP81NullableIntersectionTypes() + /** + * Verify recognition of PHP 8.2 stand-alone `true` type. + * + * @return void + */ + public function testPHP82PseudoTypeTrue() + { + $expected = [ + 'scope' => 'public', + 'scope_specified' => false, + 'return_type' => '?true', + 'nullable_return_type' => true, + 'is_abstract' => false, + 'is_final' => false, + 'is_static' => false, + 'has_body' => true, + ]; + + $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); + + }//end testPHP82PseudoTypeTrue() + + + /** + * Verify recognition of PHP 8.2 type declaration with (illegal) type false combined with type true. + * + * @return void + */ + public function testPHP82PseudoTypeFalseAndTrue() + { + $expected = [ + 'scope' => 'public', + 'scope_specified' => false, + 'return_type' => 'true|false', + 'nullable_return_type' => false, + 'is_abstract' => false, + 'is_final' => false, + 'is_static' => false, + 'has_body' => true, + ]; + + $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); + + }//end testPHP82PseudoTypeFalseAndTrue() + + /** * Test helper. * @@ -902,7 +948,10 @@ private function getMethodPropertiesTestHelper($commentString, $expected) $function = $this->getTargetToken($commentString, [T_FUNCTION, T_CLOSURE, T_FN]); $found = self::$phpcsFile->getMethodProperties($function); - $this->assertArraySubset($expected, $found, true); + // Unset those indexes which are not being tested. + unset($found['return_type_token'], $found['return_type_end_token']); + + $this->assertSame($expected, $found); }//end getMethodPropertiesTestHelper() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php index ea2dddba..d40bee98 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\File; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.php index 2c9f57cd..26e589e0 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.php @@ -5,7 +5,7 @@ * @author Willington Vega * @author Juliette Reinders Folmer * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Filters\Filter; @@ -33,40 +33,20 @@ class AcceptTest extends TestCase protected static $ruleset; - /** - * Initialize the test. - * - * @return void - */ - public function setUp() - { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - - }//end setUp() - - /** * Initialize the config and ruleset objects based on the `AcceptTest.xml` ruleset file. * + * @beforeClass + * * @return void */ - public static function setUpBeforeClass() + public static function initializeConfigAndRuleset() { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // This test will be skipped. - return; - } - $standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; self::$config = new Config(["--standard=$standard", "--ignore=*/somethingelse/*"]); self::$ruleset = new Ruleset(self::$config); - }//end setUpBeforeClass() + }//end initializeConfigAndRuleset() /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/IsCamelCapsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/IsCamelCapsTest.php index b60d524b..94766260 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/IsCamelCapsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/IsCamelCapsTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php new file mode 100644 index 00000000..934801b6 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php @@ -0,0 +1,60 @@ + + * @copyright 2023 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Ruleset; +use PHPUnit\Framework\TestCase; + +/** + * Test the Ruleset::explain() function. + * + * @covers \PHP_CodeSniffer\Ruleset::explain + */ +class ExplainTest extends TestCase +{ + + + /** + * Test the output of the "explain" command. + * + * @return void + */ + public function testExplain() + { + // Set up the ruleset. + $config = new Config(['--standard=PSR1', '-e']); + $ruleset = new Ruleset($config); + + $expected = PHP_EOL; + $expected .= 'The PSR1 standard contains 8 sniffs'.PHP_EOL.PHP_EOL; + $expected .= 'Generic (4 sniffs)'.PHP_EOL; + $expected .= '------------------'.PHP_EOL; + $expected .= ' Generic.Files.ByteOrderMark'.PHP_EOL; + $expected .= ' Generic.NamingConventions.UpperCaseConstantName'.PHP_EOL; + $expected .= ' Generic.PHP.DisallowAlternativePHPTags'.PHP_EOL; + $expected .= ' Generic.PHP.DisallowShortOpenTag'.PHP_EOL.PHP_EOL; + $expected .= 'PSR1 (3 sniffs)'.PHP_EOL; + $expected .= '---------------'.PHP_EOL; + $expected .= ' PSR1.Classes.ClassDeclaration'.PHP_EOL; + $expected .= ' PSR1.Files.SideEffects'.PHP_EOL; + $expected .= ' PSR1.Methods.CamelCapsMethodName'.PHP_EOL.PHP_EOL; + $expected .= 'Squiz (1 sniff)'.PHP_EOL; + $expected .= '---------------'.PHP_EOL; + $expected .= ' Squiz.Classes.ValidClassName'.PHP_EOL; + + $this->expectOutputString($expected); + + $ruleset->explain(); + + }//end testExplain() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Category/SetPropertyAllowedAsDeclaredSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Category/SetPropertyAllowedAsDeclaredSniff.php new file mode 100644 index 00000000..7eeed212 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Category/SetPropertyAllowedAsDeclaredSniff.php @@ -0,0 +1,28 @@ +magic[$name] = $value; + } + + public function __get($name) + { + if (isset($this->magic[$name])) { + return $this->magic[$name]; + } + + return null; + } + + public function register() + { + return [T_WHITESPACE]; + } + + public function process(File $phpcsFile, $stackPtr) + { + // Do something. + } +} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Category/SetPropertyAllowedViaStdClassSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Category/SetPropertyAllowedViaStdClassSniff.php new file mode 100644 index 00000000..6ffffad3 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Category/SetPropertyAllowedViaStdClassSniff.php @@ -0,0 +1,26 @@ + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Ruleset; @@ -41,17 +41,12 @@ class RuleInclusionAbsoluteLinuxTest extends TestCase /** * Initialize the config and ruleset objects. * + * @before + * * @return void */ - public function setUp() + public function initializeConfigAndRuleset() { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - $this->standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; $repoRootDir = dirname(dirname(dirname(__DIR__))); @@ -74,19 +69,21 @@ public function setUp() $config = new Config(["--standard={$this->standard}"]); $this->ruleset = new Ruleset($config); - }//end setUp() + }//end initializeConfigAndRuleset() /** * Reset ruleset file. * + * @after + * * @return void */ - public function tearDown() + public function resetRuleset() { file_put_contents($this->standard, $this->contents); - }//end tearDown() + }//end resetRuleset() /** @@ -98,7 +95,6 @@ public function tearDown() public function testLinuxStylePathRuleInclusion() { // Test that the sniff is correctly registered. - $this->assertObjectHasAttribute('sniffCodes', $this->ruleset); $this->assertCount(1, $this->ruleset->sniffCodes); $this->assertArrayHasKey('Generic.Formatting.SpaceAfterNot', $this->ruleset->sniffCodes); $this->assertSame( diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml index 64d1aae6..2978cef9 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml @@ -1,5 +1,5 @@ - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php index f8e3255b..d838e01f 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Ruleset; @@ -41,21 +41,16 @@ class RuleInclusionAbsoluteWindowsTest extends TestCase /** * Initialize the config and ruleset objects. * + * @before + * * @return void */ - public function setUp() + public function initializeConfigAndRuleset() { if (DIRECTORY_SEPARATOR === '/') { $this->markTestSkipped('Windows specific test'); } - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - $this->standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; $repoRootDir = dirname(dirname(dirname(__DIR__))); @@ -73,21 +68,23 @@ public function setUp() $config = new Config(["--standard={$this->standard}"]); $this->ruleset = new Ruleset($config); - }//end setUp() + }//end initializeConfigAndRuleset() /** * Reset ruleset file. * + * @after + * * @return void */ - public function tearDown() + public function resetRuleset() { if (DIRECTORY_SEPARATOR !== '/') { file_put_contents($this->standard, $this->contents); } - }//end tearDown() + }//end resetRuleset() /** @@ -99,7 +96,6 @@ public function tearDown() public function testWindowsStylePathRuleInclusion() { // Test that the sniff is correctly registered. - $this->assertObjectHasAttribute('sniffCodes', $this->ruleset); $this->assertCount(1, $this->ruleset->sniffCodes); $this->assertArrayHasKey('Generic.Formatting.SpaceAfterCast', $this->ruleset->sniffCodes); $this->assertSame( diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml index 15710d20..e92c6884 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml @@ -1,5 +1,5 @@ - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml index ca116d45..d95af20d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml @@ -1,5 +1,5 @@ - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php index 24abe8da..cab58778 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Ruleset; @@ -12,6 +12,7 @@ use PHP_CodeSniffer\Config; use PHP_CodeSniffer\Ruleset; use PHPUnit\Framework\TestCase; +use ReflectionObject; class RuleInclusionTest extends TestCase { @@ -38,35 +39,15 @@ class RuleInclusionTest extends TestCase private static $contents = ''; - /** - * Initialize the test. - * - * @return void - */ - public function setUp() - { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - - }//end setUp() - - /** * Initialize the config and ruleset objects based on the `RuleInclusionTest.xml` ruleset file. * + * @beforeClass + * * @return void */ - public static function setUpBeforeClass() + public static function initializeConfigAndRuleset() { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // This test will be skipped. - return; - } - $standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; self::$standard = $standard; @@ -91,19 +72,21 @@ public static function setUpBeforeClass() $config = new Config(["--standard=$standard"]); self::$ruleset = new Ruleset($config); - }//end setUpBeforeClass() + }//end initializeConfigAndRuleset() /** * Reset ruleset file. * + * @after + * * @return void */ - public function tearDown() + public function resetRuleset() { file_put_contents(self::$standard, self::$contents); - }//end tearDown() + }//end resetRuleset() /** @@ -113,14 +96,13 @@ public function tearDown() */ public function testHasSniffCodes() { - $this->assertObjectHasAttribute('sniffCodes', self::$ruleset); - $this->assertCount(14, self::$ruleset->sniffCodes); + $this->assertCount(48, self::$ruleset->sniffCodes); }//end testHasSniffCodes() /** - * Test that sniffs are correctly registered, independently on the syntax used to include the sniff. + * Test that sniffs are correctly registered, independently of the syntax used to include the sniff. * * @param string $key Expected array key. * @param string $value Expected array value. @@ -147,6 +129,54 @@ public function testRegisteredSniffCodes($key, $value) public function dataRegisteredSniffCodes() { return [ + [ + 'PSR2.Classes.ClassDeclaration', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff', + ], + [ + 'PSR2.Classes.PropertyDeclaration', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff', + ], + [ + 'PSR2.ControlStructures.ControlStructureSpacing', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff', + ], + [ + 'PSR2.ControlStructures.ElseIfDeclaration', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff', + ], + [ + 'PSR2.ControlStructures.SwitchDeclaration', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff', + ], + [ + 'PSR2.Files.ClosingTag', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff', + ], + [ + 'PSR2.Files.EndFileNewline', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff', + ], + [ + 'PSR2.Methods.FunctionCallSignature', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff', + ], + [ + 'PSR2.Methods.FunctionClosingBrace', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff', + ], + [ + 'PSR2.Methods.MethodDeclaration', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff', + ], + [ + 'PSR2.Namespaces.NamespaceDeclaration', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff', + ], + [ + 'PSR2.Namespaces.UseDeclaration', + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\UseDeclarationSniff', + ], [ 'PSR1.Classes.ClassDeclaration', 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff', @@ -180,8 +210,100 @@ public function dataRegisteredSniffCodes() 'PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff', ], [ - 'Zend.NamingConventions.ValidVariableName', - 'PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff', + 'Generic.Files.LineEndings', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff', + ], + [ + 'Generic.Files.LineLength', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff', + ], + [ + 'Squiz.WhiteSpace.SuperfluousWhitespace', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff', + ], + [ + 'Generic.Formatting.DisallowMultipleStatements', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff', + ], + [ + 'Generic.WhiteSpace.ScopeIndent', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff', + ], + [ + 'Generic.WhiteSpace.DisallowTabIndent', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff', + ], + [ + 'Generic.PHP.LowerCaseKeyword', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff', + ], + [ + 'Generic.PHP.LowerCaseConstant', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff', + ], + [ + 'Squiz.Scope.MethodScope', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff', + ], + [ + 'Squiz.WhiteSpace.ScopeKeywordSpacing', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff', + ], + [ + 'Squiz.Functions.FunctionDeclaration', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff', + ], + [ + 'Squiz.Functions.LowercaseFunctionKeywords', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff', + ], + [ + 'Squiz.Functions.FunctionDeclarationArgumentSpacing', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff', + ], + [ + 'PEAR.Functions.ValidDefaultValue', + 'PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff', + ], + [ + 'Squiz.Functions.MultiLineFunctionDeclaration', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff', + ], + [ + 'Generic.Functions.FunctionCallArgumentSpacing', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff', + ], + [ + 'Squiz.ControlStructures.ControlSignature', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff', + ], + [ + 'Squiz.WhiteSpace.ControlStructureSpacing', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff', + ], + [ + 'Squiz.WhiteSpace.ScopeClosingBrace', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff', + ], + [ + 'Squiz.ControlStructures.ForEachLoopDeclaration', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff', + ], + [ + 'Squiz.ControlStructures.ForLoopDeclaration', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff', + ], + [ + 'Squiz.ControlStructures.LowercaseDeclaration', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff', + ], + [ + 'Generic.ControlStructures.InlineControlStructure', + 'PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff', + ], + [ + 'PSR12.Operators.OperatorSpacing', + 'PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff', ], [ 'Generic.Arrays.ArrayIndent', @@ -191,10 +313,6 @@ public function dataRegisteredSniffCodes() 'Generic.Metrics.CyclomaticComplexity', 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff', ], - [ - 'Generic.Files.LineLength', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff', - ], [ 'Generic.NamingConventions.CamelCapsFunctionName', 'PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff', @@ -222,9 +340,11 @@ public function dataRegisteredSniffCodes() */ public function testSettingProperties($sniffClass, $propertyName, $expectedValue) { - $this->assertObjectHasAttribute('sniffs', self::$ruleset); $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs); - $this->assertObjectHasAttribute($propertyName, self::$ruleset->sniffs[$sniffClass]); + + $hasProperty = (new ReflectionObject(self::$ruleset->sniffs[$sniffClass]))->hasProperty($propertyName); + $errorMsg = sprintf('Property %s does not exist on sniff class %s', $propertyName, $sniffClass); + $this->assertTrue($hasProperty, $errorMsg); $actualValue = self::$ruleset->sniffs[$sniffClass]->$propertyName; $this->assertSame($expectedValue, $actualValue); @@ -242,49 +362,54 @@ public function testSettingProperties($sniffClass, $propertyName, $expectedValue public function dataSettingProperties() { return [ - 'ClassDeclarationSniff' => [ - 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff', - 'setforallsniffs', - true, + 'Set property for complete standard: PSR2 ClassDeclaration' => [ + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff', + 'indent', + '20', ], - 'SideEffectsSniff' => [ - 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff', - 'setforallsniffs', - true, + 'Set property for complete standard: PSR2 SwitchDeclaration' => [ + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff', + 'indent', + '20', ], - 'ValidVariableNameSniff' => [ - 'PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff', - 'setforallincategory', - true, + 'Set property for complete standard: PSR2 FunctionCallSignature' => [ + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff', + 'indent', + '20', ], - 'ArrayIndentSniff' => [ + 'Set property for complete category: PSR12 OperatorSpacing' => [ + 'PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff', + 'ignoreSpacingBeforeAssignments', + false, + ], + 'Set property for individual sniff: Generic ArrayIndent' => [ 'PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff', 'indent', '2', ], - 'LineLengthSniff' => [ + 'Set property for individual sniff using sniff file inclusion: Generic LineLength' => [ 'PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff', 'lineLimit', '10', ], - 'CamelCapsFunctionNameSniff' => [ + 'Set property for individual sniff using sniff file inclusion: CamelCapsFunctionName' => [ 'PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff', 'strict', false, ], - 'NestingLevelSniff-nestingLevel' => [ + 'Set property for individual sniff via included ruleset: NestingLevel - nestingLevel' => [ 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff', 'nestingLevel', '2', ], - 'NestingLevelSniff-setforsniffsinincludedruleset' => [ + 'Set property for all sniffs in an included ruleset: NestingLevel - absoluteNestingLevel' => [ 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff', - 'setforsniffsinincludedruleset', + 'absoluteNestingLevel', true, ], // Testing that setting a property at error code level does *not* work. - 'CyclomaticComplexitySniff' => [ + 'Set property for error code will not change the sniff property value: CyclomaticComplexity' => [ 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff', 'complexity', 10, @@ -294,4 +419,55 @@ public function dataSettingProperties() }//end dataSettingProperties() + /** + * Test that setting properties for standards, categories on sniffs which don't support the property will + * silently ignore the property and not set it. + * + * @param string $sniffClass The name of the sniff class. + * @param string $propertyName The name of the property which should not be set. + * + * @dataProvider dataSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails + * + * @return void + */ + public function testSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails($sniffClass, $propertyName) + { + $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs, 'Sniff class '.$sniffClass.' not listed in registered sniffs'); + + $sniffObject = self::$ruleset->sniffs[$sniffClass]; + + $hasProperty = (new ReflectionObject(self::$ruleset->sniffs[$sniffClass]))->hasProperty($propertyName); + $errorMsg = sprintf('Property %s registered for sniff %s which does not support it', $propertyName, $sniffClass); + $this->assertFalse($hasProperty, $errorMsg); + + }//end testSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails() + + + /** + * Data provider. + * + * @see self::testSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails() + * + * @return array + */ + public function dataSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails() + { + return [ + 'Set property for complete standard: PSR2 ClassDeclaration' => [ + 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff', + 'setforallsniffs', + ], + 'Set property for complete standard: PSR2 FunctionCallSignature' => [ + 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff', + 'setforallsniffs', + ], + 'Set property for complete category: PSR12 OperatorSpacing' => [ + 'PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff', + 'setforallincategory', + ], + ]; + + }//end dataSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails() + + }//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml index 06ce040e..e1812bbb 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml @@ -1,15 +1,17 @@ - + + - + + @@ -38,8 +40,9 @@ + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml new file mode 100644 index 00000000..70859bac --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml new file mode 100644 index 00000000..65e22555 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml new file mode 100644 index 00000000..ba094db2 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml new file mode 100644 index 00000000..7c4ca4fd --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml new file mode 100644 index 00000000..979b48f5 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml new file mode 100644 index 00000000..48a36a83 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml new file mode 100644 index 00000000..e411520c --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml new file mode 100644 index 00000000..5dca1a01 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetSniffPropertyTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetSniffPropertyTest.php new file mode 100644 index 00000000..1b3d955c --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetSniffPropertyTest.php @@ -0,0 +1,399 @@ + + * @copyright 2022 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Ruleset; +use PHPUnit\Framework\TestCase; +use ReflectionObject; + +/** + * These tests specifically focus on the changes made to work around the PHP 8.2 dynamic properties deprecation. + * + * @covers \PHP_CodeSniffer\Ruleset::setSniffProperty + */ +class SetSniffPropertyTest extends TestCase +{ + + + /** + * Test that setting a property via the ruleset works in all situations which allow for it. + * + * @param string $name Name of the test. Used for the sniff name, the ruleset file name etc. + * + * @dataProvider dataSniffPropertiesGetSetWhenAllowed + * + * @return void + */ + public function testSniffPropertiesGetSetWhenAllowed($name) + { + $sniffCode = "Fixtures.Category.{$name}"; + $sniffClass = 'Fixtures\Sniffs\Category\\'.$name.'Sniff'; + $properties = [ + 'arbitrarystring' => 'arbitraryvalue', + 'arbitraryarray' => [ + 'mykey' => 'myvalue', + 'otherkey' => 'othervalue', + ], + ]; + + // Set up the ruleset. + $standard = __DIR__."/{$name}Test.xml"; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // Verify that the sniff has been registered. + $this->assertGreaterThan(0, count($ruleset->sniffCodes), 'No sniff codes registered'); + + // Verify that our target sniff has been registered. + $this->assertArrayHasKey($sniffCode, $ruleset->sniffCodes, 'Target sniff not registered'); + $this->assertSame($sniffClass, $ruleset->sniffCodes[$sniffCode], 'Target sniff not registered with the correct class'); + + // Test that the property as declared in the ruleset has been set on the sniff. + $this->assertArrayHasKey($sniffClass, $ruleset->sniffs, 'Sniff class not listed in registered sniffs'); + + $sniffObject = $ruleset->sniffs[$sniffClass]; + foreach ($properties as $name => $expectedValue) { + $this->assertSame($expectedValue, $sniffObject->$name, 'Property value not set to expected value'); + } + + }//end testSniffPropertiesGetSetWhenAllowed() + + + /** + * Data provider. + * + * @see self::testSniffPropertiesGetSetWhenAllowed() + * + * @return array + */ + public function dataSniffPropertiesGetSetWhenAllowed() + { + return [ + 'Property allowed as explicitly declared' => ['SetPropertyAllowedAsDeclared'], + 'Property allowed as sniff extends stdClass' => ['SetPropertyAllowedViaStdClass'], + 'Property allowed as sniff has magic __set() method' => ['SetPropertyAllowedViaMagicMethod'], + ]; + + }//end dataSniffPropertiesGetSetWhenAllowed() + + + /** + * Test that setting a property for a category will apply it correctly to those sniffs which support the + * property, but won't apply it to sniffs which don't. + * + * Note: this test intentionally uses the `PEAR.Functions` category as two sniffs in that category + * have a public property with the same name (`indent`) and one sniff doesn't, which makes it a great + * test case for this. + * + * @return void + */ + public function testSetPropertyAppliesPropertyToMultipleSniffsInCategory() + { + $propertyName = 'indent'; + $expectedValue = '10'; + + // Set up the ruleset. + $standard = __DIR__.'/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml'; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // Test that the two sniffs which support the property have received the value. + $sniffClass = 'PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff'; + $this->assertArrayHasKey($sniffClass, $ruleset->sniffs, 'Sniff class '.$sniffClass.' not listed in registered sniffs'); + $sniffObject = $ruleset->sniffs[$sniffClass]; + $this->assertSame($expectedValue, $sniffObject->$propertyName, 'Property value not set to expected value for '.$sniffClass); + + $sniffClass = 'PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff'; + $this->assertArrayHasKey($sniffClass, $ruleset->sniffs, 'Sniff class '.$sniffClass.' not listed in registered sniffs'); + $sniffObject = $ruleset->sniffs[$sniffClass]; + $this->assertSame($expectedValue, $sniffObject->$propertyName, 'Property value not set to expected value for '.$sniffClass); + + // Test that the property doesn't get set for the one sniff which doesn't support the property. + $sniffClass = 'PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff'; + $this->assertArrayHasKey($sniffClass, $ruleset->sniffs, 'Sniff class '.$sniffClass.' not listed in registered sniffs'); + + $hasProperty = (new ReflectionObject($ruleset->sniffs[$sniffClass]))->hasProperty($propertyName); + $errorMsg = sprintf('Property %s registered for sniff %s which does not support it', $propertyName, $sniffClass); + $this->assertFalse($hasProperty, $errorMsg); + + }//end testSetPropertyAppliesPropertyToMultipleSniffsInCategory() + + + /** + * Test that attempting to set a non-existent property directly on a sniff will throw an error + * when the sniff does not explicitly declare the property, extends stdClass or has magic methods. + * + * @return void + */ + public function testSetPropertyThrowsErrorOnInvalidProperty() + { + $exceptionClass = 'PHP_CodeSniffer\Exceptions\RuntimeException'; + $exceptionMsg = 'Ruleset invalid. Property "indentation" does not exist on sniff Generic.Arrays.ArrayIndent'; + if (method_exists($this, 'expectException') === true) { + $this->expectException($exceptionClass); + $this->expectExceptionMessage($exceptionMsg); + } else { + // PHPUnit < 5.2.0. + $this->setExpectedException($exceptionClass, $exceptionMsg); + } + + // Set up the ruleset. + $standard = __DIR__.'/SetPropertyThrowsErrorOnInvalidPropertyTest.xml'; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + }//end testSetPropertyThrowsErrorOnInvalidProperty() + + + /** + * Test that attempting to set a non-existent property directly on a sniff will throw an error + * when the sniff does not explicitly declare the property, extends stdClass or has magic methods, + * even though the sniff has the PHP 8.2 `#[AllowDynamicProperties]` attribute set. + * + * @return void + */ + public function testSetPropertyThrowsErrorWhenPropertyOnlyAllowedViaAttribute() + { + $exceptionClass = 'PHP_CodeSniffer\Exceptions\RuntimeException'; + $exceptionMsg = 'Ruleset invalid. Property "arbitrarystring" does not exist on sniff Fixtures.Category.SetPropertyNotAllowedViaAttribute'; + if (method_exists($this, 'expectException') === true) { + $this->expectException($exceptionClass); + $this->expectExceptionMessage($exceptionMsg); + } else { + // PHPUnit < 5.2.0. + $this->setExpectedException($exceptionClass, $exceptionMsg); + } + + // Set up the ruleset. + $standard = __DIR__.'/SetPropertyNotAllowedViaAttributeTest.xml'; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + }//end testSetPropertyThrowsErrorWhenPropertyOnlyAllowedViaAttribute() + + + /** + * Test that attempting to set a non-existent property on a sniff when the property directive is + * for the whole standard, does not yield an error. + * + * @doesNotPerformAssertions + * + * @return void + */ + public function testSetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandard() + { + // Set up the ruleset. + $standard = __DIR__.'/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml'; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + }//end testSetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandard() + + + /** + * Test that attempting to set a non-existent property on a sniff when the property directive is + * for a whole category, does not yield an error. + * + * @doesNotPerformAssertions + * + * @return void + */ + public function testSetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategory() + { + // Set up the ruleset. + $standard = __DIR__.'/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml'; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + }//end testSetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategory() + + + /** + * Test that setting a property via a direct call to the Ruleset::setSniffProperty() method + * sets the property correctly when using the new $settings array format. + * + * @return void + */ + public function testDirectCallWithNewArrayFormatSetsProperty() + { + $name = 'SetPropertyAllowedAsDeclared'; + $sniffCode = "Fixtures.Category.{$name}"; + $sniffClass = 'Fixtures\Sniffs\Category\\'.$name.'Sniff'; + + // Set up the ruleset. + $standard = __DIR__."/{$name}Test.xml"; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $propertyName = 'arbitrarystring'; + $propertyValue = 'new value'; + + $ruleset->setSniffProperty( + $sniffClass, + $propertyName, + [ + 'scope' => 'sniff', + 'value' => $propertyValue, + ] + ); + + // Verify that the sniff has been registered. + $this->assertGreaterThan(0, count($ruleset->sniffCodes), 'No sniff codes registered'); + + // Verify that our target sniff has been registered. + $this->assertArrayHasKey($sniffCode, $ruleset->sniffCodes, 'Target sniff not registered'); + $this->assertSame($sniffClass, $ruleset->sniffCodes[$sniffCode], 'Target sniff not registered with the correct class'); + + // Test that the property as declared in the ruleset has been set on the sniff. + $this->assertArrayHasKey($sniffClass, $ruleset->sniffs, 'Sniff class not listed in registered sniffs'); + + $sniffObject = $ruleset->sniffs[$sniffClass]; + $this->assertSame($propertyValue, $sniffObject->$propertyName, 'Property value not set to expected value'); + + }//end testDirectCallWithNewArrayFormatSetsProperty() + + + /** + * Test that setting a property via a direct call to the Ruleset::setSniffProperty() method + * sets the property correctly when using the old $settings array format. + * + * Tested by silencing the deprecation notice as otherwise the test would fail on the deprecation notice. + * + * @param mixed $propertyValue Value for the property to set. + * + * @dataProvider dataDirectCallWithOldArrayFormatSetsProperty + * + * @return void + */ + public function testDirectCallWithOldArrayFormatSetsProperty($propertyValue) + { + $name = 'SetPropertyAllowedAsDeclared'; + $sniffCode = "Fixtures.Category.{$name}"; + $sniffClass = 'Fixtures\Sniffs\Category\\'.$name.'Sniff'; + + // Set up the ruleset. + $standard = __DIR__."/{$name}Test.xml"; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $propertyName = 'arbitrarystring'; + + @$ruleset->setSniffProperty( + $sniffClass, + $propertyName, + $propertyValue + ); + + // Verify that the sniff has been registered. + $this->assertGreaterThan(0, count($ruleset->sniffCodes), 'No sniff codes registered'); + + // Verify that our target sniff has been registered. + $this->assertArrayHasKey($sniffCode, $ruleset->sniffCodes, 'Target sniff not registered'); + $this->assertSame($sniffClass, $ruleset->sniffCodes[$sniffCode], 'Target sniff not registered with the correct class'); + + // Test that the property as declared in the ruleset has been set on the sniff. + $this->assertArrayHasKey($sniffClass, $ruleset->sniffs, 'Sniff class not listed in registered sniffs'); + + $sniffObject = $ruleset->sniffs[$sniffClass]; + $this->assertSame($propertyValue, $sniffObject->$propertyName, 'Property value not set to expected value'); + + }//end testDirectCallWithOldArrayFormatSetsProperty() + + + /** + * Data provider. + * + * @see self::testDirectCallWithOldArrayFormatSetsProperty() + * + * @return array + */ + public function dataDirectCallWithOldArrayFormatSetsProperty() + { + return [ + 'Property value is not an array (boolean)' => [false], + 'Property value is not an array (string)' => ['a string'], + 'Property value is an empty array' => [[]], + 'Property value is an array without keys' => [ + [ + 'value', + false, + ], + ], + 'Property value is an array without the "scope" or "value" keys' => [ + [ + 'key1' => 'value', + 'key2' => false, + ], + ], + 'Property value is an array without the "scope" key' => [ + [ + 'key1' => 'value', + 'value' => true, + ], + ], + 'Property value is an array without the "value" key' => [ + [ + 'scope' => 'value', + 'key2' => 1234, + ], + ], + ]; + + }//end dataDirectCallWithOldArrayFormatSetsProperty() + + + /** + * Test that setting a property via a direct call to the Ruleset::setSniffProperty() method + * throws a deprecation notice when using the old $settings array format. + * + * Note: as PHPUnit stops as soon as it sees the deprecation notice, the setting of the property + * value is not tested here. + * + * @return void + */ + public function testDirectCallWithOldArrayFormatThrowsDeprecationNotice() + { + $exceptionClass = 'PHPUnit\Framework\Error\Deprecated'; + if (class_exists($exceptionClass) === false) { + $exceptionClass = 'PHPUnit_Framework_Error_Deprecated'; + } + + $exceptionMsg = 'the format of the $settings parameter has changed from (mixed) $value to array(\'scope\' => \'sniff|standard\', \'value\' => $value). Please update your integration code. See PR #3629 for more information.'; + + if (method_exists($this, 'expectException') === true) { + $this->expectException($exceptionClass); + $this->expectExceptionMessage($exceptionMsg); + } else { + // PHPUnit < 5.2.0. + $this->setExpectedException($exceptionClass, $exceptionMsg); + } + + $name = 'SetPropertyAllowedAsDeclared'; + $sniffCode = "Fixtures.Category.{$name}"; + $sniffClass = 'Fixtures\Sniffs\Category\\'.$name.'Sniff'; + + // Set up the ruleset. + $standard = __DIR__."/{$name}Test.xml"; + $config = new Config(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $propertyName = 'arbitrarystring'; + + $ruleset->setSniffProperty( + $sniffClass, + 'arbitrarystring', + ['key' => 'value'] + ); + + }//end testDirectCallWithOldArrayFormatThrowsDeprecationNotice() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.php index 20c28d60..c74513ca 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Sniffs; @@ -31,14 +31,16 @@ class AbstractArraySniffTest extends AbstractMethodUnitTest * The test case file for a unit test class has to be in the same directory * directory and use the same file name as the test class, using the .inc extension. * + * @beforeClass + * * @return void */ - public static function setUpBeforeClass() + public static function initializeFile() { self::$sniff = new AbstractArraySniffTestable(); - parent::setUpBeforeClass(); + parent::initializeFile(); - }//end setUpBeforeClass() + }//end initializeFile() /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php b/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php index a224012f..751b01a8 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Sniffs; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AnonClassParenthesisOwnerTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AnonClassParenthesisOwnerTest.php index a4bc49f9..9a547097 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AnonClassParenthesisOwnerTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AnonClassParenthesisOwnerTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.php index 237258a6..b831ed74 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php index 8ac826f2..1593f0f4 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php @@ -4,7 +4,7 @@ * * @author Alessandro Chitolina * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillEnumTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillEnumTest.php index 33cff3a2..7c726721 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillEnumTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillEnumTest.php @@ -4,7 +4,7 @@ * * @author Jaroslav Hanslík * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.inc index 154d4895..eb907ed3 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.inc @@ -26,3 +26,6 @@ $foo = 0o28_2; /* testInvalid6 */ $foo = 0o2_82; + +/* testInvalid7 */ +$foo = 0o; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php index e1c55bd9..a01754a5 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillExplicitOctalNotationTest.php @@ -4,7 +4,7 @@ * * @author Mark Baker * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; @@ -106,6 +106,12 @@ public function dataExplicitOctalNotation() 'nextToken' => T_STRING, 'nextContent' => '_82', ], + [ + 'marker' => '/* testInvalid7 */', + 'value' => '0', + 'nextToken' => T_STRING, + 'nextContent' => 'o', + ], ]; }//end dataExplicitOctalNotation() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.php index 4d0f4c06..e6935331 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.php index 80f909ac..72ca61e6 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.php @@ -5,7 +5,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillNumericSeparatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillNumericSeparatorTest.php index 645088fd..4b96801b 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillNumericSeparatorTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillNumericSeparatorTest.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.inc index eaf0b4b3..1e66d464 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.inc @@ -49,9 +49,7 @@ class Foo public ReAdOnLy string $caseInsensitiveProperty; /* testReadonlyConstructorPropertyPromotion */ - public function __construct(private readonly bool $constructorPropertyPromotion) - { - } + public function __construct(private readonly bool $constructorPropertyPromotion) {} /* testReadonlyConstructorPropertyPromotionWithReference */ public function __construct(private ReadOnly bool &$constructorPropertyPromotion) {} @@ -68,8 +66,6 @@ class ClassName { /* testReadonlyUsedAsMethodName */ public function readonly() { - // Do something. - /* testReadonlyUsedAsPropertyName */ $this->readonly = 'foo'; @@ -79,9 +75,10 @@ class ClassName { } /* testReadonlyUsedAsFunctionName */ -function readonly() -{ -} +function readonly() {} + +/* testReadonlyUsedAsFunctionNameWithReturnByRef */ +function &readonly() {} /* testReadonlyUsedAsNamespaceName */ namespace Readonly; @@ -89,12 +86,58 @@ namespace Readonly; namespace My\Readonly\Collection; /* testReadonlyAsFunctionCall */ $var = readonly($a, $b); +/* testReadonlyAsNamespacedFunctionCall */ +$var = My\NS\readonly($a, $b); +/* testReadonlyAsNamespaceRelativeFunctionCall */ +$var = namespace\ReadOnly($a, $b); +/* testReadonlyAsMethodCall */ +$var = $obj->readonly($a, $b); +/* testReadonlyAsNullsafeMethodCall */ +$var = $obj?->readOnly($a, $b); +/* testReadonlyAsStaticMethodCallWithSpace */ +$var = ClassName::readonly ($a, $b); /* testClassConstantFetchWithReadonlyAsConstantName */ echo ClassName::READONLY; /* testReadonlyUsedAsFunctionCallWithSpaceBetweenKeywordAndParens */ $var = readonly /* comment */ (); +// These test cases are inspired by +// https://github.com/php/php-src/commit/08b75395838b4b42a41e3c70684fa6c6b113eee0 +class ReadonlyWithDisjunctiveNormalForm +{ + /* testReadonlyPropertyDNFTypeUnqualified */ + readonly (B&C)|A $h; + + /* testReadonlyPropertyDNFTypeFullyQualified */ + public readonly (\Fully\Qualified\B&\Full\C)|\Foo\Bar $j; + + /* testReadonlyPropertyDNFTypePartiallyQualified */ + protected readonly (Partially\Qualified&C)|A $l; + + /* testReadonlyPropertyDNFTypeRelativeName */ + private readonly (namespace\Relative&C)|A $n; + + /* testReadonlyPropertyDNFTypeMultipleSets */ + private readonly (A&C)|(B&C)|(C&D) $m; + + /* testReadonlyPropertyDNFTypeWithArray */ + private readonly (B & C)|array $o; + + /* testReadonlyPropertyDNFTypeWithSpacesAndComments */ + private readonly ( B & C /*something*/) | A $q; + + public function __construct( + /* testReadonlyConstructorPropertyPromotionWithDNF */ + private readonly (B&C)|A $b1, + /* testReadonlyConstructorPropertyPromotionWithDNFAndRefence */ + readonly (B&C)|A &$b2, + ) {} + + /* testReadonlyUsedAsMethodNameWithDNFParam */ + public function readonly (A&B $param): void {} +} + /* testParseErrorLiveCoding */ // This must be the last test in the file. readonly diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.php index dddc18eb..024220d3 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillReadonlyTest.php @@ -4,7 +4,7 @@ * * @author Jaroslav Hanslík * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; @@ -148,7 +148,39 @@ public function dataReadonly() 'readonly', ], [ - '/* testReadonlyUsedAsFunctionCallWithSpaceBetweenKeywordAndParens */', + '/* testReadonlyPropertyDNFTypeUnqualified */', + 'readonly', + ], + [ + '/* testReadonlyPropertyDNFTypeFullyQualified */', + 'readonly', + ], + [ + '/* testReadonlyPropertyDNFTypePartiallyQualified */', + 'readonly', + ], + [ + '/* testReadonlyPropertyDNFTypeRelativeName */', + 'readonly', + ], + [ + '/* testReadonlyPropertyDNFTypeMultipleSets */', + 'readonly', + ], + [ + '/* testReadonlyPropertyDNFTypeWithArray */', + 'readonly', + ], + [ + '/* testReadonlyPropertyDNFTypeWithSpacesAndComments */', + 'readonly', + ], + [ + '/* testReadonlyConstructorPropertyPromotionWithDNF */', + 'readonly', + ], + [ + '/* testReadonlyConstructorPropertyPromotionWithDNFAndRefence */', 'readonly', ], [ @@ -212,6 +244,10 @@ public function dataNotReadonly() '/* testReadonlyUsedAsFunctionName */', 'readonly', ], + [ + '/* testReadonlyUsedAsFunctionNameWithReturnByRef */', + 'readonly', + ], [ '/* testReadonlyUsedAsNamespaceName */', 'Readonly', @@ -224,10 +260,38 @@ public function dataNotReadonly() '/* testReadonlyAsFunctionCall */', 'readonly', ], + [ + '/* testReadonlyAsNamespacedFunctionCall */', + 'readonly', + ], + [ + '/* testReadonlyAsNamespaceRelativeFunctionCall */', + 'ReadOnly', + ], + [ + '/* testReadonlyAsMethodCall */', + 'readonly', + ], + [ + '/* testReadonlyAsNullsafeMethodCall */', + 'readOnly', + ], + [ + '/* testReadonlyAsStaticMethodCallWithSpace */', + 'readonly', + ], [ '/* testClassConstantFetchWithReadonlyAsConstantName */', 'READONLY', ], + [ + '/* testReadonlyUsedAsFunctionCallWithSpaceBetweenKeywordAndParens */', + 'readonly', + ], + [ + '/* testReadonlyUsedAsMethodNameWithDNFParam */', + 'readonly', + ], ]; }//end dataNotReadonly() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.inc index bfdbdc18..b758aba0 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.inc @@ -48,6 +48,9 @@ class TypeUnion /* testTypeUnionPropertyWithOnlyReadOnlyKeyword */ readonly string|null $nullableString; + /* testTypeUnionPropertyWithOnlyStaticKeyword */ + static Foo|Bar $obj; + public function paramTypes( /* testTypeUnionParam1 */ int|float $paramA /* testBitwiseOrParamDefaultValue */ = CONSTANT_A | CONSTANT_B, @@ -129,6 +132,15 @@ $obj->fn($something | $else); /* testTypeUnionNonArrowFunctionDeclaration */ function &fn(int|false $something) {} +/* testTypeUnionPHP82TrueFirst */ +function trueTypeParam(true|null $param) {} + +/* testTypeUnionPHP82TrueMiddle */ +function trueTypeReturn($param): array|true|null {} + +/* testTypeUnionPHP82TrueLast */ +$closure = function ($param): array|true {} + /* testLiveCoding */ // Intentional parse error. This has to be the last test in the file. return function( type| diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.php index d56e7340..81e10e01 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; @@ -110,6 +110,7 @@ public function dataTypeUnion() ['/* testTypeUnionPropertyWithStaticAndReadOnlyKeywords */'], ['/* testTypeUnionPropertyWithVarAndReadOnlyKeywords */'], ['/* testTypeUnionPropertyWithOnlyReadOnlyKeyword */'], + ['/* testTypeUnionPropertyWithOnlyStaticKeyword */'], ['/* testTypeUnionParam1 */'], ['/* testTypeUnionParam2 */'], ['/* testTypeUnionParam3 */'], @@ -130,6 +131,9 @@ public function dataTypeUnion() ['/* testTypeUnionArrowParam */'], ['/* testTypeUnionArrowReturnType */'], ['/* testTypeUnionNonArrowFunctionDeclaration */'], + ['/* testTypeUnionPHP82TrueFirst */'], + ['/* testTypeUnionPHP82TrueMiddle */'], + ['/* testTypeUnionPHP82TrueLast */'], ]; }//end dataTypeUnion() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.inc index 82fe5643..bc98c49f 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.inc @@ -1,227 +1,264 @@ - 'a', - 2 => 'b', - /* testMatchDefaultIsKeyword */ default => 'default', -}; - -$closure = /* testFnIsKeyword */ fn () => 'string'; - -function () { - /* testYieldIsKeyword */ yield $f; - /* testYieldFromIsKeyword */ yield from someFunction(); -}; - -/* testDeclareIsKeyword */ declare(ticks=1): -/* testEndDeclareIsKeyword */ enddeclare; - -if (true /* testAndIsKeyword */ and false /* testOrIsKeyword */ or null /* testXorIsKeyword */ xor 0) { - -} - -$anonymousClass = new /* testAnonymousClassIsKeyword */ class {}; -$anonymousClass2 = new class /* testExtendsInAnonymousClassIsKeyword */ extends SomeParent {}; -$anonymousClass3 = new class /* testImplementsInAnonymousClassIsKeyword */ implements SomeInterface {}; - -$instantiated1 = new /* testClassInstantiationParentIsKeyword */ parent(); -$instantiated2 = new /* testClassInstantiationSelfIsKeyword */ SELF; -$instantiated3 = new /* testClassInstantiationStaticIsKeyword */ static($param); - -class Foo extends /* testNamespaceInNameIsKeyword */ namespace\Exception -{} - -function /* testKeywordAfterFunctionShouldBeString */ eval() {} -function /* testKeywordAfterFunctionByRefShouldBeString */ &switch() {} + 'a', + 2 => 'b', + /* testMatchDefaultIsKeyword */ default => 'default', +}; + +$closure = /* testFnIsKeyword */ fn () => 'string'; + +function () { + /* testYieldIsKeyword */ yield $f; + /* testYieldFromIsKeyword */ yield from someFunction(); +}; + +/* testDeclareIsKeyword */ declare(ticks=1): +/* testEndDeclareIsKeyword */ enddeclare; + +if (true /* testAndIsKeyword */ and false /* testOrIsKeyword */ or null /* testXorIsKeyword */ xor 0) { + +} + +$anonymousClass = new /* testAnonymousClassIsKeyword */ class {}; +$anonymousClass2 = new class /* testExtendsInAnonymousClassIsKeyword */ extends SomeParent {}; +$anonymousClass3 = new class /* testImplementsInAnonymousClassIsKeyword */ implements SomeInterface {}; + +$instantiated1 = new /* testClassInstantiationParentIsKeyword */ parent(); +$instantiated2 = new /* testClassInstantiationSelfIsKeyword */ SELF; +$instantiated3 = new /* testClassInstantiationStaticIsKeyword */ static($param); + +class Foo extends /* testNamespaceInNameIsKeyword */ namespace\Exception +{} + +function /* testKeywordAfterFunctionShouldBeString */ eval() {} +function /* testKeywordAfterFunctionByRefShouldBeString */ &switch() {} + +function /* testKeywordSelfAfterFunctionByRefShouldBeString */ &self() {} +function /* testKeywordStaticAfterFunctionByRefShouldBeString */ &static() {} +function /* testKeywordParentAfterFunctionByRefShouldBeString */ &parent() {} +function /* testKeywordFalseAfterFunctionByRefShouldBeString */ &false() {} +function /* testKeywordTrueAfterFunctionByRefShouldBeString */ & true () {} +function /* testKeywordNullAfterFunctionByRefShouldBeString */ &NULL() {} + +/* testKeywordAsFunctionCallNameShouldBeStringSelf */ self(); +/* testKeywordAsFunctionCallNameShouldBeStringStatic */ static(); +$obj-> /* testKeywordAsMethodCallNameShouldBeStringStatic */ static(); +/* testKeywordAsFunctionCallNameShouldBeStringParent */ parent(); +/* testKeywordAsFunctionCallNameShouldBeStringFalse */ false(); +/* testKeywordAsFunctionCallNameShouldBeStringTrue */ True (); +/* testKeywordAsFunctionCallNameShouldBeStringNull */ null /*comment*/ (); + +$instantiated4 = new /* testClassInstantiationFalseIsString */ False(); +$instantiated5 = new /* testClassInstantiationTrueIsString */ true (); +$instantiated6 = new /* testClassInstantiationNullIsString */ null(); + +$function = /* testStaticIsKeywordBeforeClosure */ static function(/* testStaticIsKeywordWhenParamType */ static $param) {}; +$arrow = /* testStaticIsKeywordBeforeArrow */ static fn(): /* testStaticIsKeywordWhenReturnType */ static => 10; + +function standAloneFalseTrueNullTypesAndMore( + /* testFalseIsKeywordAsParamType */ false $paramA, + /* testTrueIsKeywordAsParamType */ true $paramB, + /* testNullIsKeywordAsParamType */ null $paramC, +) /* testFalseIsKeywordAsReturnType */ false | /* testTrueIsKeywordAsReturnType */ true | /* testNullIsKeywordAsReturnType */ null { + if ($a === /* testFalseIsKeywordInComparison */ false + || $a === /* testTrueIsKeywordInComparison */ true + || $a === /* testNullIsKeywordInComparison */ null + ) {} +} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.php index a747e573..21233511 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ContextSensitiveKeywordsTest.php @@ -4,7 +4,7 @@ * * @author Jaroslav Hanslík * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; @@ -30,7 +30,7 @@ public function testStrings($testMarker) { $tokens = self::$phpcsFile->getTokens(); - $token = $this->getTargetToken($testMarker, (Tokens::$contextSensitiveKeywords + [T_STRING])); + $token = $this->getTargetToken($testMarker, (Tokens::$contextSensitiveKeywords + [T_STRING, T_NULL, T_FALSE, T_TRUE, T_PARENT, T_SELF])); $this->assertSame(T_STRING, $tokens[$token]['code']); $this->assertSame('T_STRING', $tokens[$token]['type']); @@ -120,6 +120,9 @@ public function dataStrings() ['/* testAnd */'], ['/* testOr */'], ['/* testXor */'], + ['/* testFalse */'], + ['/* testTrue */'], + ['/* testNull */'], ['/* testKeywordAfterNamespaceShouldBeString */'], ['/* testNamespaceNameIsString1 */'], @@ -128,6 +131,24 @@ public function dataStrings() ['/* testKeywordAfterFunctionShouldBeString */'], ['/* testKeywordAfterFunctionByRefShouldBeString */'], + ['/* testKeywordSelfAfterFunctionByRefShouldBeString */'], + ['/* testKeywordStaticAfterFunctionByRefShouldBeString */'], + ['/* testKeywordParentAfterFunctionByRefShouldBeString */'], + ['/* testKeywordFalseAfterFunctionByRefShouldBeString */'], + ['/* testKeywordTrueAfterFunctionByRefShouldBeString */'], + ['/* testKeywordNullAfterFunctionByRefShouldBeString */'], + + ['/* testKeywordAsFunctionCallNameShouldBeStringSelf */'], + ['/* testKeywordAsFunctionCallNameShouldBeStringStatic */'], + ['/* testKeywordAsMethodCallNameShouldBeStringStatic */'], + ['/* testKeywordAsFunctionCallNameShouldBeStringParent */'], + ['/* testKeywordAsFunctionCallNameShouldBeStringFalse */'], + ['/* testKeywordAsFunctionCallNameShouldBeStringTrue */'], + ['/* testKeywordAsFunctionCallNameShouldBeStringNull */'], + + ['/* testClassInstantiationFalseIsString */'], + ['/* testClassInstantiationTrueIsString */'], + ['/* testClassInstantiationNullIsString */'], ]; }//end dataStrings() @@ -148,7 +169,10 @@ public function testKeywords($testMarker, $expectedTokenType) { $tokens = self::$phpcsFile->getTokens(); - $token = $this->getTargetToken($testMarker, (Tokens::$contextSensitiveKeywords + [T_ANON_CLASS, T_MATCH_DEFAULT, T_PARENT, T_SELF, T_STRING])); + $token = $this->getTargetToken( + $testMarker, + (Tokens::$contextSensitiveKeywords + [T_ANON_CLASS, T_MATCH_DEFAULT, T_PARENT, T_SELF, T_STRING, T_NULL, T_FALSE, T_TRUE]) + ); $this->assertSame(constant($expectedTokenType), $tokens[$token]['code']); $this->assertSame($expectedTokenType, $tokens[$token]['type']); @@ -501,6 +525,60 @@ public function dataKeywords() '/* testNamespaceInNameIsKeyword */', 'T_NAMESPACE', ], + + [ + '/* testStaticIsKeywordBeforeClosure */', + 'T_STATIC', + ], + [ + '/* testStaticIsKeywordWhenParamType */', + 'T_STATIC', + ], + [ + '/* testStaticIsKeywordBeforeArrow */', + 'T_STATIC', + ], + [ + '/* testStaticIsKeywordWhenReturnType */', + 'T_STATIC', + ], + + [ + '/* testFalseIsKeywordAsParamType */', + 'T_FALSE', + ], + [ + '/* testTrueIsKeywordAsParamType */', + 'T_TRUE', + ], + [ + '/* testNullIsKeywordAsParamType */', + 'T_NULL', + ], + [ + '/* testFalseIsKeywordAsReturnType */', + 'T_FALSE', + ], + [ + '/* testTrueIsKeywordAsReturnType */', + 'T_TRUE', + ], + [ + '/* testNullIsKeywordAsReturnType */', + 'T_NULL', + ], + [ + '/* testFalseIsKeywordInComparison */', + 'T_FALSE', + ], + [ + '/* testTrueIsKeywordInComparison */', + 'T_TRUE', + ], + [ + '/* testNullIsKeywordInComparison */', + 'T_NULL', + ], ]; }//end dataKeywords() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.php index 9a5b061a..9f89ce59 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.php @@ -5,7 +5,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.php index ad1a411f..e1a0174d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.php @@ -6,7 +6,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleQuotedStringTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleQuotedStringTest.php index cc9fe49e..4e837bab 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleQuotedStringTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleQuotedStringTest.php @@ -5,7 +5,7 @@ * * @author Juliette Reinders Folmer * @copyright 2022 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/EnumCaseTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/EnumCaseTest.php index 61141da4..d4b6fe7c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/EnumCaseTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/EnumCaseTest.php @@ -4,7 +4,7 @@ * * @author Jaroslav Hanslík * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php index 2b28bc5d..d5e089a0 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.php index 0f937cc8..b4d1e8a4 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; @@ -32,7 +32,7 @@ public function testGotoStatement($testMarker, $testContent) $label = $this->getTargetToken($testMarker, T_STRING); - $this->assertInternalType('int', $label); + $this->assertTrue(is_int($label)); $this->assertSame($testContent, $tokens[$label]['content']); }//end testGotoStatement() @@ -78,7 +78,7 @@ public function testGotoDeclaration($testMarker, $testContent) $label = $this->getTargetToken($testMarker, T_GOTO_LABEL); - $this->assertInternalType('int', $label); + $this->assertTrue(is_int($label)); $this->assertSame($testContent, $tokens[$label]['content']); }//end testGotoDeclaration() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.php index 6e322407..9d34c5e1 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; @@ -29,9 +29,11 @@ class HeredocNowdocCloserTest extends AbstractMethodUnitTest * {@internal This is a near duplicate of the original method. Only difference is that * tab replacement is enabled for this test.} * + * @beforeClass + * * @return void */ - public static function setUpBeforeClass() + public static function initializeFile() { $config = new Config(); $config->standards = ['PSR1']; @@ -51,7 +53,7 @@ public static function setUpBeforeClass() self::$phpcsFile = new DummyFile($contents, $ruleset, $config); self::$phpcsFile->process(); - }//end setUpBeforeClass() + }//end initializeFile() /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php index 2c808be9..993fd98c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php @@ -5,7 +5,7 @@ * * @author Juliette Reinders Folmer * @copyright 2022 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php index cc57637c..8819a202 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.php index 8e465a3b..83b48e67 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php index 23cbd987..14317954 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php index 1d97894f..3cf9cd14 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceTest.php index 389bb74e..781fc1b7 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceTest.php @@ -10,7 +10,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceWinTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceWinTest.php index d2ab47ca..ff9720cd 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceWinTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceWinTest.php @@ -7,7 +7,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.inc index abf9b85b..ad421cba 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.inc @@ -36,6 +36,9 @@ class TypeIntersection /* testTypeIntersectionPropertyWithReadOnlyKeyword */ protected readonly Foo&Bar $fooBar; + /* testTypeIntersectionPropertyWithStaticKeyword */ + static Foo&Bar $obj; + public function paramTypes( /* testTypeIntersectionParam1 */ Foo&Bar $paramA /* testBitwiseAndParamDefaultValue */ = CONSTANT_A & CONSTANT_B, diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.php index 21700219..fcfd191a 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/TypeIntersectionTest.php @@ -5,7 +5,7 @@ * @author Juliette Reinders Folmer * @author Jaroslav Hanslík * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; @@ -109,6 +109,7 @@ public function dataTypeIntersection() ['/* testTypeIntersectionPropertyPartiallyQualified */'], ['/* testTypeIntersectionPropertyFullyQualified */'], ['/* testTypeIntersectionPropertyWithReadOnlyKeyword */'], + ['/* testTypeIntersectionPropertyWithStaticKeyword */'], ['/* testTypeIntersectionParam1 */'], ['/* testTypeIntersectionParam2 */'], ['/* testTypeIntersectionParam3 */'], diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.php index 24667e48..72ee773f 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.php @@ -14,7 +14,7 @@ * * @author Juliette Reinders Folmer * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; diff --git a/vendor/squizlabs/php_codesniffer/tests/FileList.php b/vendor/squizlabs/php_codesniffer/tests/FileList.php index 8ef57b7a..1672411d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/FileList.php +++ b/vendor/squizlabs/php_codesniffer/tests/FileList.php @@ -4,7 +4,7 @@ * * @author Juliette Reinders Folmer * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests; diff --git a/vendor/squizlabs/php_codesniffer/tests/Standards/AbstractSniffUnitTest.php b/vendor/squizlabs/php_codesniffer/tests/Standards/AbstractSniffUnitTest.php index c050a0c2..9bf61587 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Standards/AbstractSniffUnitTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Standards/AbstractSniffUnitTest.php @@ -8,7 +8,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Standards; @@ -50,15 +50,17 @@ abstract class AbstractSniffUnitTest extends TestCase /** * Sets up this unit test. * + * @before + * * @return void */ - protected function setUp() + protected function setUpPrerequisites() { $class = get_class($this); $this->standardsDir = $GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'][$class]; $this->testsDir = $GLOBALS['PHP_CODESNIFFER_TEST_DIRS'][$class]; - }//end setUp() + }//end setUpPrerequisites() /** @@ -88,7 +90,7 @@ protected function getTestFiles($testFileBase) } // Put them in order. - sort($testFiles); + sort($testFiles, SORT_NATURAL); return $testFiles; @@ -431,7 +433,6 @@ public function generateFailureMessages(LocalFile $file) */ public function setCliValues($filename, $config) { - return; }//end setCliValues() diff --git a/vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php b/vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php index 24527dd5..e355d90d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php +++ b/vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Standards; @@ -61,20 +61,11 @@ public static function suite() foreach ($installedStandards as $standard => $details) { Autoload::addSearchPath($details['path'], $details['namespace']); - // If the test is running PEAR installed, the built-in standards - // are split into different directories; one for the sniffs and - // a different file system location for tests. - if ($isInstalled === true && is_dir(dirname($details['path']).DIRECTORY_SEPARATOR.'Generic') === true) { - $testPath = realpath(__DIR__.'/../../src/Standards/'.$standard); - } else { - $testPath = $details['path']; - } - if (in_array($standard, $ignoreTestsForStandards, true) === true) { continue; } - $testsDir = $testPath.DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR; + $testsDir = $details['path'].DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR; if (is_dir($testsDir) === false) { // No tests for this standard. continue; diff --git a/vendor/squizlabs/php_codesniffer/tests/TestSuite.php b/vendor/squizlabs/php_codesniffer/tests/TestSuite.php index 9eb269f8..ff7bde7e 100644 --- a/vendor/squizlabs/php_codesniffer/tests/TestSuite.php +++ b/vendor/squizlabs/php_codesniffer/tests/TestSuite.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests; diff --git a/vendor/squizlabs/php_codesniffer/tests/TestSuite7.php b/vendor/squizlabs/php_codesniffer/tests/TestSuite7.php index 43db293d..a4dabf5f 100644 --- a/vendor/squizlabs/php_codesniffer/tests/TestSuite7.php +++ b/vendor/squizlabs/php_codesniffer/tests/TestSuite7.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests; diff --git a/vendor/squizlabs/php_codesniffer/tests/bootstrap.php b/vendor/squizlabs/php_codesniffer/tests/bootstrap.php index 47084d11..8d91b156 100644 --- a/vendor/squizlabs/php_codesniffer/tests/bootstrap.php +++ b/vendor/squizlabs/php_codesniffer/tests/bootstrap.php @@ -4,7 +4,7 @@ * * @author Greg Sherwood * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ if (defined('PHP_CODESNIFFER_IN_TESTS') === false) { @@ -44,13 +44,6 @@ class_alias('PHPUnit_TextUI_TestRunner', 'PHPUnit'.'\TextUI\TestRunner'); class_alias('PHPUnit_Framework_TestResult', 'PHPUnit'.'\Framework\TestResult'); } -// Determine whether this is a PEAR install or not. -$GLOBALS['PHP_CODESNIFFER_PEAR'] = false; - -if (is_file(__DIR__.'/../autoload.php') === false) { - $GLOBALS['PHP_CODESNIFFER_PEAR'] = true; -} - /** * A global util function to help print unit test fixing data.